public void ExcudeParameterWithNoTypeNoMethod( Type type, Mock <MethodBase> methodMock, Mock <ParameterInfo> parameterMock, IEnumerable <RegexRule> otherRules, RegexFilter sut) { // Arrange parameterMock.SetupGet(m => m.Name).Returns("Name" + Guid.NewGuid()); sut.Rules.AddRange(otherRules); sut.ExcludeParameter(parameterMock.Object.Name); // Act bool actual = ((IParameterFilter)sut).ExcludeParameter(type, methodMock.Object, parameterMock.Object); // Assert Assert.True(actual); }
public void EnsureIncludeParameterTakesPrecedenceOverExcudeParameter( Type type, Mock <MethodBase> methodMock, Mock <ParameterInfo> parameterMock, IEnumerable <RegexRule> otherRules, RegexFilter sut) { // Arrange methodMock.SetupGet(m => m.Name).Returns("Name" + Guid.NewGuid()); parameterMock.SetupGet(m => m.Name).Returns("Name" + Guid.NewGuid()); sut.Rules.AddRange(otherRules); sut.ExcludeParameter(parameterMock.Object.Name, type, methodMock.Object.Name) .IncludeParameter(parameterMock.Object.Name); // Act bool actual = ((IParameterFilter)sut).ExcludeParameter(type, methodMock.Object, parameterMock.Object); // Assert Assert.False(actual); }
public void EnsureIncludeParameterTakesPrecedenceOverExcudeParameter( Type type, Mock<MethodBase> methodMock, Mock<ParameterInfo> parameterMock, IEnumerable<RegexRule> otherRules, RegexFilter sut) { // Arrange methodMock.SetupGet(m => m.Name).Returns("Name" + Guid.NewGuid()); parameterMock.SetupGet(m => m.Name).Returns("Name" + Guid.NewGuid()); sut.Rules.AddRange(otherRules); sut.ExcludeParameter(parameterMock.Object.Name, type, methodMock.Object.Name) .IncludeParameter(parameterMock.Object.Name); // Act bool actual = ((IParameterFilter)sut).ExcludeParameter(type, methodMock.Object, parameterMock.Object); // Assert Assert.False(actual); }
public void ExcudeParameterWithNoTypeNoMethod( Type type, Mock<MethodBase> methodMock, Mock<ParameterInfo> parameterMock, IEnumerable<RegexRule> otherRules, RegexFilter sut) { // Arrange parameterMock.SetupGet(m => m.Name).Returns("Name" + Guid.NewGuid()); sut.Rules.AddRange(otherRules); sut.ExcludeParameter(parameterMock.Object.Name); // Act bool actual = ((IParameterFilter)sut).ExcludeParameter(type, methodMock.Object, parameterMock.Object); // Assert Assert.True(actual); }