public void ShouldMatchOnOutParams() { ParameterTypeMatchingRule rule = new ParameterTypeMatchingRule( new ParameterTypeMatchingInfo[] { new ParameterTypeMatchingInfo("System.Int32", false, ParameterKind.Output) }); Assert.IsTrue(rule.Matches(targetWithOutParams)); Assert.IsFalse(rule.Matches(targetMethodInt)); }
public void ShouldMatchOnReturnType() { ParameterTypeMatchingRule rule = new ParameterTypeMatchingRule( new ParameterTypeMatchingInfo[] { new ParameterTypeMatchingInfo("System.String", false, ParameterKind.ReturnValue) }); Assert.IsFalse(rule.Matches(targetMethodString)); Assert.IsTrue(rule.Matches(returnsAString)); }
public void ShouldMatchInOrOut() { ParameterTypeMatchingRule rule = new ParameterTypeMatchingRule( new ParameterTypeMatchingInfo[] { new ParameterTypeMatchingInfo("System.Int32", false, ParameterKind.InputOrOutput) }); Assert.IsTrue(rule.Matches(targetWithOutParams)); Assert.IsTrue(rule.Matches(targetMethodInt)); }
public void ShouldMatchOnReturnType() { ParameterTypeMatchingRule rule = new ParameterTypeMatchingRule( new ParameterTypeMatchingInfo[] { new ParameterTypeMatchingInfo("System.String", false, ParameterKind.ReturnValue) }); Assert.IsFalse(rule.Matches(targetMethodString)); Assert.IsTrue(rule.Matches(returnsAString)); }
public void ShouldMatchOnSingleInputParameter() { ParameterTypeMatchingRule rule = new ParameterTypeMatchingRule( new ParameterTypeMatchingInfo[] { new ParameterTypeMatchingInfo("System.String", false, ParameterKind.Input) }); Assert.IsTrue(rule.Matches(targetMethodString)); Assert.IsFalse(rule.Matches(targetMethodInt)); }
public void ShouldMatchOnSingleInputParameter() { ParameterTypeMatchingRule rule = new ParameterTypeMatchingRule( new ParameterTypeMatchingInfo[] { new ParameterTypeMatchingInfo("System.String", false, ParameterKind.Input) }); Assert.IsTrue(rule.Matches(targetMethodString)); Assert.IsFalse(rule.Matches(targetMethodInt)); }
public void ShouldMatchOnOneOfManyParameters() { ParameterTypeMatchingRule rule = new ParameterTypeMatchingRule( new ParameterTypeMatchingInfo[] { new ParameterTypeMatchingInfo("System.Int32", false, ParameterKind.Input) }); Assert.IsTrue(rule.Matches(targetMethodInt)); Assert.IsTrue(rule.Matches(targetMethodIntString)); Assert.IsTrue(rule.Matches(targetMethodStringInt)); Assert.IsFalse(rule.Matches(returnsAString)); }
public void ShouldMatchOnOneOfManyParameters() { ParameterTypeMatchingRule rule = new ParameterTypeMatchingRule( new ParameterTypeMatchingInfo[] { new ParameterTypeMatchingInfo("System.Int32", false, ParameterKind.Input) }); Assert.IsTrue(rule.Matches(targetMethodInt)); Assert.IsTrue(rule.Matches(targetMethodIntString)); Assert.IsTrue(rule.Matches(targetMethodStringInt)); Assert.IsFalse(rule.Matches(returnsAString)); }
public void ShouldMatchOr() { ParameterTypeMatchingRule rule = new ParameterTypeMatchingRule( new ParameterTypeMatchingInfo[] { new ParameterTypeMatchingInfo("System.Int32", false, ParameterKind.InputOrOutput), new ParameterTypeMatchingInfo("String", false, ParameterKind.InputOrOutput), }); Assert.IsTrue(rule.Matches(targetMethodString)); Assert.IsTrue(rule.Matches(targetMethodInt)); Assert.IsTrue(rule.Matches(targetMethodIntString)); Assert.IsTrue(rule.Matches(targetWithOutParams)); Assert.IsFalse(rule.Matches(returnsAString)); }
public void ShouldMatchOr() { ParameterTypeMatchingRule rule = new ParameterTypeMatchingRule( new ParameterTypeMatchingInfo[] { new ParameterTypeMatchingInfo("System.Int32", false, ParameterKind.InputOrOutput), new ParameterTypeMatchingInfo("String", false, ParameterKind.InputOrOutput), }); Assert.IsTrue(rule.Matches(targetMethodString)); Assert.IsTrue(rule.Matches(targetMethodInt)); Assert.IsTrue(rule.Matches(targetMethodIntString)); Assert.IsTrue(rule.Matches(targetWithOutParams)); Assert.IsFalse(rule.Matches(returnsAString)); }