public void ExcludeProperty_prevents_testing_a_property() { var sut = new AssemblyTester(Assembly.Load("NSimpleTester.Tests.PropertyErrors")); // verity the assembly has issues first so we know the test is valid. Assert.Throws <InvalidOperationException>(() => sut.TestAssembly()); sut.ExcludeProperty("TestTypeWBadINotifyPropertyChanged", "PropertyTwo"); sut.TestAssembly(); }
public void ExcludeEqualityTests_prevents_any_equality_tests() { var sut = new AssemblyTester(Assembly.Load("NSimpleTester.Tests.EqualityErrors")); // verity the assembly has issues first so we know the test is valid. Assert.Throws <InvalidOperationException>(() => sut.TestAssembly()); sut.ExcludeEqualityTests(); sut.TestAssembly(); }
public void ExcludeConstructor_prevents_any_constructor_tests() { var sut = new AssemblyTester(Assembly.Load("NSimpleTester.Tests.ConstructorErrors")); // verity the assembly has issues first so we know the test is valid. Assert.Throws <InvalidOperationException>(() => sut.TestAssembly()); sut.ExcludeConstructor("ConstructorParameterNotMapped", new MethodSignature(new Type[] {})); sut.TestAssembly(); }
public void ExcludeClass_prevents_executing_any_tests_on_a_class() { var sut = new AssemblyTester(Assembly.Load("NSimpleTester.Tests.ConstructorErrors")); // verity the assembly has issues first so we know the test is valid. Assert.Throws <InvalidOperationException>(() => sut.TestAssembly()); sut.ExcludeClass("ConstructorParameterNotMapped"); sut.TestAssembly(); }
public void TestExcludedProperties() { var tester = new AssemblyTester(typeof(IncorrectConstructors).Assembly); tester.Exclusions.AddType(typeof(GenericClass<>)); tester.AddPropertyExclusions(typeof(IncorrectProperties), "Dummy4", "Dummy3"); tester.TestAssembly(true, false); }
public void TestExcludedPropertiesLambda() { var tester = new AssemblyTester(typeof(IncorrectConstructors).Assembly); tester.Exclusions.AddType(typeof(GenericClass<>)); tester.AddConstructorExclusion(() => new IncorrectConstructors(string.Empty,0, false,string.Empty)); tester.AddConstructorExclusion(() => new IncorrectConstructors(string.Empty, string.Empty)); tester.TestAssembly(false, true); }
public void TestExcludedProperties() { var tester = new AssemblyTester(typeof(IncorrectConstructors).Assembly); tester.Exclusions.AddType(typeof(GenericClass<>)); tester.AddConstructorExclusion(typeof(IncorrectConstructors), typeof(string), typeof(int), typeof(bool), typeof(string)); tester.AddConstructorExclusion(typeof(IncorrectConstructors), typeof(string), typeof(string)); tester.TestAssembly(false, true); }
public void TestExcludedPropertiesWithLambda() { var tester = new AssemblyTester(typeof(IncorrectConstructors).Assembly); tester.Exclusions.AddType(typeof(GenericClass<>)); tester.AddPropertyExclusion<IncorrectProperties>(x => x.Dummy4); tester.AddPropertyExclusion<IncorrectProperties>(x => x.Dummy3); tester.TestAssembly(true, false); }