예제 #1
0
        /// <summary>
        ///A test for GetInstanceOfType
        ///</summary>
        public T GetInstanceOfTypeTestHelper <T>(Enum keyToTest)
            where T : class
        {
            Enum key = keyToTest;
            T    actual;

            actual = ControlRegistrator.GetInstanceOfType <T>(key);
            Assert.IsInstanceOfType(typeof(T), actual);
            return(actual);
        }
예제 #2
0
        /// <summary>
        ///A test for GetInstanceOfType
        ///</summary>
        public T GetInstanceOfTypeTest1Helper <T>(Enum keyToTest, object[] constructorParameters)
            where T : class
        {
            Enum key = keyToTest;

            object[] parameters = constructorParameters;

            // T expected = default(T);
            T actual;

            actual = ControlRegistrator.GetInstanceOfType <T>(key, parameters);
            if (actual != null)
            {
                Assert.IsInstanceOfType(typeof(T), actual);
            }
            return(actual);
        }
예제 #3
0
 public void GetInstanceOfTypeTest()
 {
     GetInstanceOfTypeTestHelper <MyClass>(kind);
     Assert.Throws <KeyNotFoundException>(() => ControlRegistrator.GetInstanceOfType <MyClass>(MyEnum.ValueTwo));
 }