public void FormatEmpty() { // action var tryFormatResult = Rfc822TimestampFormatter.TryFormatTimestampAsString(null, out _); // assert Assert.False(tryFormatResult); }
public void FormatInputs(string expectedOutput, DateTimeOffset input) { // action var tryFormatResult = Rfc822TimestampFormatter.TryFormatTimestampAsString(input, out var actualOutput); // assert Assert.True(tryFormatResult); Assert.Equal(expectedOutput, actualOutput); }
private static bool TryFormatRss20Timestamp(DateTimeOffset?timestampToFormat, XName elementName, out XElement element) { element = default; if (!Rfc822TimestampFormatter.TryFormatTimestampAsString(timestampToFormat, out var timestampString)) { return(false); } element = new XElement(elementName, timestampString); return(true); }