public void UnsafeQueryTest() { method = GetMethodForTest("UnsafeQuery"); messageCollection = rule.CheckMethod(method, new MinimalRunner()); Assert.IsNotNull(messageCollection); Assert.AreEqual(1, messageCollection.Count); }
public void toStringReturningNullTest() { type = GetTest("ToStringReturningNull"); foreach (MethodDefinition method in type.Methods) { messageCollection = methodRule.CheckMethod(method, new MinimalRunner()); } Assert.IsNotNull(messageCollection); Assert.AreEqual(1, messageCollection.Count); }
public void equalsChecksForNullArgTest() { type = GetTest("EqualsChecksForNullArg"); foreach (MethodDefinition method in type.Methods) { if (method.Name == "Equals") { messageCollection = methodRule.CheckMethod(method, new MinimalRunner()); } } Assert.IsNull(messageCollection); }
private void CheckMethods(IMethodRule rule, ICollection methods, Runner runner) { foreach (MethodDefinition method in methods) { AddExistingMessages(rule.CheckMethod(method, runner)); } }
public void callToEqualsWithNullArgTest() { type = GetTest("CallToEqualsWithNullArg"); foreach (MethodDefinition method in type.Methods) { messageCollection = methodRule.CheckMethod(method, new MinimalRunner()); } Assert.IsNotNull(messageCollection); Assert.AreEqual(1, messageCollection.Count); }
public void propertyTest() { type = GetTest("ClassContainingProperty"); foreach (MethodDefinition method in type.Methods) { messageCollection = methodRule.CheckMethod(method, new MinimalRunner()); } Assert.IsNull(messageCollection); }
MessageCollection CheckMethod(MethodDefinition method) { return(rule.CheckMethod(method, new MinimalRunner())); }
public void uncalledPrivateMethodTest() { type = GetTest("UncalledPrivateMethod"); foreach (MethodDefinition method in type.Methods) { if (method.Name == "display") { messageCollection = methodRule.CheckMethod(method, new MinimalRunner()); } } Assert.IsNotNull(messageCollection); Assert.AreEqual(1, messageCollection.Count); }
public void PrintBannerUsingParameterTest() { method = GetMethodForTest("PrintBannerUsingParameter"); messageCollection = rule.CheckMethod(method, new MinimalRunner()); Assert.IsNull(messageCollection); }
public void SwallowErrorsCatchingExceptionsEmptyCatchBlockTest() { method = type.Methods.GetMethod("SwallowErrorsCatchingExceptionEmptyCatchBlock", Type.EmptyTypes); messageCollection = rule.CheckMethod(method, new MinimalRunner()); Assert.IsNotNull(messageCollection); Assert.AreEqual(messageCollection.Count, 1); CheckMessageType(messageCollection, MessageType.Error); }
private void CheckMethods (IMethodRule rule, ICollection methods, Runner runner) { foreach (MethodDefinition method in methods) { AddExistingMessages (rule.CheckMethod (method, runner)); } }
public void MethodWithoutParametersTest() { method = GetMethodForTest("MethodWithoutParameters", Type.EmptyTypes); messageCollection = rule.CheckMethod(method, new MinimalRunner()); Assert.IsNull(messageCollection); }