public void ToTimeSpan_Invalid(long seconds, int nanoseconds) { var duration = new Duration { Seconds = seconds, Nanos = nanoseconds }; Assert.Throws <InvalidOperationException>(() => duration.ToTimeSpan()); }
public void ToTimeSpan_Valid(long seconds, int nanoseconds) { // Only testing that these values don't throw, unlike their similar tests in ToTimeSpan_Invalid var duration = new Duration { Seconds = seconds, Nanos = nanoseconds }; duration.ToTimeSpan(); }