public void IsMatchForTypeReturnsPredicateResult(bool isMatch) { var value = Guid.NewGuid().ToString(); var priority = Environment.TickCount; var sut = new TypePredicateCreationRule(item => isMatch, () => value, priority); var actual = sut.IsMatch(typeof(string)); actual.Should().Be(isMatch); }
public void IsMatchForPropertyReturnsFalse() { var propertyInfo = typeof(Person).GetProperty(nameof(Person.FirstName)) !; var value = Guid.NewGuid().ToString(); var priority = Environment.TickCount; var sut = new TypePredicateCreationRule(item => true, () => value, priority); var actual = sut.IsMatch(propertyInfo); actual.Should().BeFalse(); }
public void IsMatchForParameterReturnsFalse() { var parameterInfo = typeof(Person).GetConstructors() .First(x => x.GetParameters().FirstOrDefault()?.Name == "firstName").GetParameters().First(); var value = Guid.NewGuid().ToString(); var priority = Environment.TickCount; var sut = new TypePredicateCreationRule(item => true, () => value, priority); var actual = sut.IsMatch(parameterInfo); actual.Should().BeFalse(); }