コード例 #1
0
        public void CanNewInstance()
        {
            TestClassWithConstructor objWithDefaultSingleton = StaticContainer.NewInstance <TestClassWithConstructor>();

            Assert.IsNotNull(objWithDefaultSingleton);
            Assert.AreSame(DEFAULT_EMPTY_CLASS, objWithDefaultSingleton.TestEmptyCls);

            TestClassWithCustomConstructor objWithCustomSingleton = StaticContainer.NewInstance <TestClassWithCustomConstructor>();

            Assert.IsNotNull(objWithCustomSingleton);
            Assert.AreSame(CUSTOM_EMPTY_CLASS, objWithCustomSingleton.TestEmptyCls);
        }