public void TryParseReturnsExpectedResultWhenValueIsUnknown() { var value = _fixture.Create <string>(); var result = RoadSegmentStatus.TryParse(value, out RoadSegmentStatus parsed); Assert.False(result); Assert.Null(parsed); }
public void TryParseReturnsExpectedResultWhenValueIsWellKnown() { var value = _knownValues[new Random().Next(0, _knownValues.Length)]; var result = RoadSegmentStatus.TryParse(value, out RoadSegmentStatus parsed); Assert.True(result); Assert.NotNull(parsed); Assert.Equal(value, parsed.ToString()); }
public void TryParseValueCanNotBeNull() { Assert.Throws <ArgumentNullException>(() => RoadSegmentStatus.TryParse(null, out _)); }