public void RemoveIgnoreRuleRemovesRulesFromCompilerTest() { var target = new BuildStrategyCompiler(); target.AddIgnoreRule<DummyIgnoreRule>(); target.RemoveIgnoreRule<DummyIgnoreRule>(); target.IgnoreRules.Should().BeEmpty(); }
public void AddIgnoreRuleWithExpressionAddsRuleToCompilerTest() { var target = new BuildStrategyCompiler(); target.AddIgnoreRule<Person>(x => x.FirstName); var rule = target.IgnoreRules.Single(); rule.TargetType.Should().Be<Person>(); rule.PropertyName.Should().Be(nameof(Person.FirstName)); }
public void AddIgnoreRuleWithExpressionThrowsExceptionWithNullExpressionTest() { var target = new BuildStrategyCompiler(); Action action = () => target.AddIgnoreRule((Expression<Func<Person, object>>) null); action.ShouldThrow<ArgumentNullException>(); }
public void AddIgnoreRuleAddsRuleToCompilerTest() { var target = new BuildStrategyCompiler(); target.AddIgnoreRule<DummyIgnoreRule>(); var actual = target.IgnoreRules.Single(); actual.Should().BeOfType<DummyIgnoreRule>(); }