public bool Match([CanBeNull] MatchDto match) { var active = _context.Value; if (active == null) { return(false); } return(match?.IsMatch(active.Class, active.Exe) == true); }
public void Should_FollowAllNonNullCondition_WhileMatching() { // Arrange var match = new MatchDto("class", "exe"); // Act var result = match.IsMatch("class", "wrong"); // Assert result.Should().BeFalse(); }
public void Should_IgnoreAnyOfNullConditions_WhileMatching() { // Arrange var match = new MatchDto(null, "exe"); // Act var result = match.IsMatch("class", "exe"); // Assert result.Should().BeTrue(); }