/// <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); }
/// <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); }
public void GetInstanceOfTypeTest() { GetInstanceOfTypeTestHelper <MyClass>(kind); Assert.Throws <KeyNotFoundException>(() => ControlRegistrator.GetInstanceOfType <MyClass>(MyEnum.ValueTwo)); }