public void ReplacementExpressions_Work( string Content, string Expected ) { // Arrange MockDateTimeNowFactory mock = new MockDateTimeNowFactory( testDate ); DateFunctionTokenizer d = new DateFunctionTokenizer( mock ); // Act string actual = d.TokenizeContent( Content ); // Assert Assert.That( actual, Is.EqualTo( Expected ) ); }
public void Format_Works( string Format ) { // Arrange string content = "__DATE(" + Format + ")__"; if ( string.IsNullOrEmpty( Format ) ) { Format = "d"; // FRAGILE: Duplicates business logic in class under test } MockDateTimeNowFactory mock = new MockDateTimeNowFactory( testDate ); DateFunctionTokenizer d = new DateFunctionTokenizer( mock ); // Act string actual = d.TokenizeContent( content ); // Assert string expected = mock.Now().ToString( Format ); Assert.That( actual, Is.EqualTo( expected ) ); }