forked from cucumber/messages
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConvertersTests.cs
More file actions
35 lines (28 loc) · 885 Bytes
/
ConvertersTests.cs
File metadata and controls
35 lines (28 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;
namespace Cucumber.Messages.Specs
{
public class ConvertersTests
{
[Fact]
public void ConvertsToAndFromTimestamp()
{
var current = DateTime.Parse("2024-06-29T17:29:47.1537257Z", null, System.Globalization.DateTimeStyles.RoundtripKind);
var timestamp = Converters.ToTimestamp(current);
var dt = Converters.ToDateTime(timestamp);
Assert.Equal(current, dt);
}
[Fact]
public void ConvertsToAndFromDuration()
{
var current = TimeSpan.FromSeconds(3.000161);
var duration = Converters.ToDuration(current);
var ts = Converters.ToTimeSpan(duration);
Assert.Equal(current, ts);
}
}
}