public void IsMatchReturnsWhetherEvaluatorMatchesTest() { var target = new ExecuteOrderRule((type, name) => false, 1000); var actual = target.IsMatch(typeof(string), "Stuff"); actual.Should().BeFalse(); }
public void ReturnsConstructorValuesTest() { var type = typeof(string); var name = Guid.NewGuid().ToString(); var priority = Environment.TickCount; var target = new ExecuteOrderRule(type, name, priority); target.Priority.Should().Be(priority); }
public void IsMatchReturnsWhetherTypeAndNameMatchTest( Type type, string name, Type matchType, string matchName, bool expected) { var priority = Environment.TickCount; var target = new ExecuteOrderRule(type, name, priority); var actual = target.IsMatch(matchType, matchName); actual.Should().Be(expected); }
public void IsMatchReturnsWhetherTypeAndRegularExpressionMatchTest( Type type, string expression, Type matchType, string matchName, bool expected) { var priority = Environment.TickCount; var regex = new Regex(expression); var target = new ExecuteOrderRule(type, regex, priority); var actual = target.IsMatch(matchType, matchName); actual.Should().Be(expected); }
public void AddWithExecuteOrderRuleThrowsExceptionWithNullCompilerTest() { var rule = new ExecuteOrderRule(typeof(Person), "FirstName", Environment.TickCount); IBuildStrategyCompiler target = null; Action action = () => target.Add(rule); action.ShouldThrow<ArgumentNullException>(); }
public void AddWithExecuteOrderRuleAddsRuleToCompilerTest() { var rule = new ExecuteOrderRule(typeof(Person), "FirstName", Environment.TickCount); var target = new BuildStrategyCompiler(); target.Add(rule); target.ExecuteOrderRules.Should().Contain(rule); }