public void AddressCityTests_VeryfyTestCaseAttributes() { var obj = new AddressCityTests(); var result = obj.GetType() .GetMethods() .Select(x => x.GetCustomAttributes(false) .Where(z => z.GetType() == typeof(TestCaseAttribute)) .Count()) .Sum(); Assert.AreEqual(2, result); }
public void AddressCityTests_VerifyNumberOfTests() { var methodsFromFramework = 4; var expectedTestCount = 8; var totalExpected = methodsFromFramework + expectedTestCount; var obj = new AddressCityTests(); var result = obj.GetType() .GetMethods() .Count(); Assert.AreEqual(totalExpected, result); }