Version 3.0.362

This commit is contained in:
Anja 2023-04-05 15:02:10 +02:00
parent cba4da9357
commit 4ff3307997
128 changed files with 3954 additions and 3193 deletions

View file

@ -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"));
}
}
}