public void CircleD_TryParse_FailsForInvalidStrings() { var result = default(CircleD); var succeeded = CircleD.TryParse("foo", out result); TheResultingValue(succeeded).ShouldBe(false); }
public void CircleD_TryParse_SucceedsForValidStrings() { var str = "123.45 456.78 100.10"; var result = default(CircleD); if (!CircleD.TryParse(str, out result)) { throw new InvalidOperationException("Unable to parse string to CircleD."); } TheResultingValue(result) .ShouldHavePosition(123.45, 456.78) .ShouldHaveRadius(100.10); }