public void TestConstructorThatDoesntExist() { MethodCache cache = new MethodCache(); Assert.Throws <MissingMethodException>(() => cache.CreateInstance <Sample1>("asd", null, 1)); }
public void TestConstructorResolutionWithNoParams() { MethodCache cache = new MethodCache(); var obj1 = cache.CreateInstance<Sample1>(); obj1.Prop.Should().Be(0); }
public void TestConstructorResolutionWith2IntParam() { MethodCache cache = new MethodCache(); var obj1 = cache.CreateInstance<Sample1>(BindingFlags.NonPublic | BindingFlags.Instance, 1, 2); obj1.Prop.Should().Be(3); }
public void TestConstructorResolutionWith1StringParam() { MethodCache cache = new MethodCache(); var obj1 = cache.CreateInstance<Sample1>("1"); obj1.Prop.Should().Be(1); }
public void TestConstructorResolutionWith2IntParamWhenOneIsNull() { MethodCache cache = new MethodCache(); var obj = cache.CreateInstance <Sample1>(BindingFlags.NonPublic | BindingFlags.Instance, 1, null); obj.Prop.Should().Be(1); }
public void TestConstructorResolutionWith2IntParam() { MethodCache cache = new MethodCache(); var obj1 = cache.CreateInstance <Sample1>(BindingFlags.NonPublic | BindingFlags.Instance, 1, 2); obj1.Prop.Should().Be(3); }
public void TestConstructorResolutionWith1StringWrongParam() { MethodCache cache = new MethodCache(); Assert.Throws <FormatException>(() => cache.CreateInstance <Sample1>("a")); }
public void TestConstructorResolutionWith1StringParam() { MethodCache cache = new MethodCache(); var obj1 = cache.CreateInstance <Sample1>("1"); obj1.Prop.Should().Be(1); }
public void TestConstructorResolutionWithNoParams() { MethodCache cache = new MethodCache(); var obj1 = cache.CreateInstance <Sample1>(); obj1.Prop.Should().Be(0); }
public void TestConstructorThatDoesntExist() { MethodCache cache = new MethodCache(); Assert.Throws<MissingMethodException>(()=> cache.CreateInstance<Sample1>("asd", null, 1)); }
public void TestConstructorResolutionWith2IntParamWhenOneIsNull() { MethodCache cache = new MethodCache(); var obj = cache.CreateInstance<Sample1>(BindingFlags.NonPublic | BindingFlags.Instance, 1, null); obj.Prop.Should().Be(1); }
public void TestConstructorResolutionWith1StringWrongParam() { MethodCache cache = new MethodCache(); Assert.Throws<FormatException>(() => cache.CreateInstance<Sample1>("a")); }