mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-22 05:47:28 +02:00
Version 3.0.362
This commit is contained in:
parent
cba4da9357
commit
4ff3307997
128 changed files with 3954 additions and 3193 deletions
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using NUnit.Framework;
|
||||
using TINK.Services;
|
||||
|
@ -64,5 +64,35 @@ namespace TestShareeLib.Services
|
|||
private class MyTypeB { }
|
||||
|
||||
private class MyTypeC { }
|
||||
|
||||
[Test]
|
||||
public void TestCtor2()
|
||||
{
|
||||
var container = new ServicesContainerMutableT<object>(new List<object> { new MyTypeA(), new MyTypeB() }, typeof(MyTypeB).FullName);
|
||||
Assert.That(container.Active.GetType().FullName, Is.EqualTo("TestShareeLib.Services.TestServicesContainerMutable+MyTypeB"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCtorExceptionDupes()
|
||||
{
|
||||
Assert.That(() => new ServicesContainerMutableT<object>(new List<object> { new MyTypeA(), new MyTypeB(), new MyTypeA() }, typeof(MyTypeB).FullName), Throws.InstanceOf<Exception>());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCtorExceptionActiveNotFound()
|
||||
{
|
||||
Assert.That(() => new ServicesContainerMutableT<object>(new List<object> { new MyTypeA(), new MyTypeB() }, "MyTypeF"), Throws.InstanceOf<ArgumentException>());
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSetActive2()
|
||||
{
|
||||
var container = new ServicesContainerMutableT<object>(new List<object> { new MyTypeA(), new MyTypeB() }, typeof(MyTypeB).FullName);
|
||||
container.SetActive(typeof(MyTypeA).FullName);
|
||||
Assert.That(container.Active.GetType().FullName, Is.EqualTo("TestShareeLib.Services.TestServicesContainerMutable+MyTypeA"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue