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