public void ParseGarbage() { Assert.AreEqual(0, FormatDuration.Parse("Garbage in, zero out. I just can't take it anymore!")); }
public void ParseOutOfOrder() { // Random order is not supported Assert.AreEqual(0, FormatDuration.Parse("17S 23H 666MS")); }
public void ParseFraction() { // Fractions are NYI Assert.AreEqual(0, FormatDuration.Parse("1.5s")); }
public void ParseHappyPathWithEverything() { Assert.AreEqual(83862666, FormatDuration.Parse("23H 17m 42s666MS")); }
public void ParseWithEmptyMinutes() { Assert.AreEqual(82817666, FormatDuration.Parse("23H 17S 666MS")); }
public void ParseMixedCase() { Assert.AreEqual(1017, FormatDuration.Parse("1s 17MS")); }
public void ParseWithSpaces() { Assert.AreEqual(1017, FormatDuration.Parse("1s 17ms")); }
public void ParseSomeMillis() { Assert.AreEqual(23, FormatDuration.Parse("23ms")); }
public void ParseOneSecond() { Assert.AreEqual(1000, FormatDuration.Parse("1s")); }
public void ParseEmpty() { Assert.AreEqual(0, FormatDuration.Parse("")); }