public void SetUp() { ControlRegistrator.Reset(); kind = MyEnum.ValueOne; type = typeof(MyClass); ControlRegistrator.RegisterControl(kind, type); }
public void GetMultipleInstancesTest() { var first = GetInstanceOfTypeTestHelper <MyClass>(kind); var second = GetInstanceOfTypeTestHelper <MyClass>(kind); Assert.AreNotEqual(first, second); Assert.AreNotSame(first, second); ControlRegistrator.Reset(); kind = MyEnum.ValueOne; type = typeof(MyClass); ControlRegistrator.RegisterControl(kind, type, new SingletonInstance()); first = GetInstanceOfTypeTestHelper <MyClass>(kind); second = GetInstanceOfTypeTestHelper <MyClass>(kind); Assert.AreEqual(first, second); Assert.AreSame(first, second); }