public void Should_check_when_should_execute(string propertyName, string propertyValue, bool shouldExecute) { var property = new KeyValuePair <string, JToken>(propertyName, propertyValue); var processor = new DateTimeProcessor(); processor.ShouldExecute(property).Should().Be(shouldExecute); }
public void TestProcessFlow() { ProcessPipe <DateTime, Object> pipeline = new DateTimeProcessor().Connect(new LowerCaseProcessor()) .Connect(new CasterPipe <String, Object>()); Object output = pipeline.Process(new DateTime(2033, 8, 27, 18, 53, 22)); Assert.AreEqual(output, "saturday, august 27, 2033 6:53:22 pm"); }
public void Should_read_request_value(string propertyName, string valueProperty, string pattern) { var result = new JObject(); var processor = new DateTimeProcessor(); processor.Execute(result, new KeyValuePair <string, JToken>(propertyName, valueProperty)); result.Should().ContainKey(propertyName); Regex.IsMatch(result[propertyName].ToString(), pattern, RegexOptions.IgnoreCase) .Should() .BeTrue(); }
public void SetUp() { _database = new Mock <IDatabase>(); _processor = new DateTimeProcessor(); }