Skip to content

Commit

Permalink
test: include test for timespan
Browse files Browse the repository at this point in the history
  • Loading branch information
Stuart.Maskell committed Jan 14, 2025
1 parent 7742167 commit 0b2dc16
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@ public void ShouldReturnNull_WhenStringHasNoDateTime()
Assert.Null(result.Date);
}

[Fact]
public void ShouldReturnTimeSpan_WhenStringHasATimeSpan()
{
// Arrange
var jsonData = $"{{\"time\": \"16:53:16.997\"}}";

// Act
var result = JsonSerializer.Deserialize<MyMockData>(jsonData);

// Assert
Assert.NotNull(result);
Assert.NotNull(result.Time);
}


private class MyMockData
{
Expand Down

0 comments on commit 0b2dc16

Please sign in to comment.