public void Size3F_TryParse_FailsForInvalidStrings() { var result = default(Size3F); var succeeded = Size3F.TryParse("foo", out result); TheResultingValue(succeeded).ShouldBe(false); }
public void Size3F_TryParse_SucceedsForValidStrings() { var str = "123.45 456.78 789.99"; var result = default(Size3F); if (!Size3F.TryParse(str, out result)) { throw new InvalidOperationException("Unable to parse string to Size3F."); } TheResultingValue(result) .ShouldBe(123.45f, 456.78f, 789.99f); }