public void LogValues_With_UnbalancedBraces(string format) { Assert.Throws <FormatException>(() => { var logValues = new FormattedLogValues(format); logValues.Format(); }); }
public void LogValues_With_Basic_Types(string expected, string format, object[] args) { var logValues = new FormattedLogValues(format, args); Assert.Equal(expected, logValues.Format()); // Original format is expected to be returned from GetValues. Assert.Equal(format, logValues.GetValues().First(v => v.Key == "{OriginalFormat}").Value); }
public void LogValues_With_DateTime(string expected, string format) { var dateTime = new DateTime(2015, 1, 1, 1, 1, 1); var logValues = new FormattedLogValues(format, new object[] { dateTime, dateTime }); Assert.Equal(expected, logValues.Format()); // Original format is expected to be returned from GetValues. Assert.Equal(format, logValues.GetValues().First(v => v.Key == "{OriginalFormat}").Value); }