예제 #1
0
        public void CanParseReturnsExpectedResultWhenValueIsWellKnown()
        {
            var value  = _knownValues[new Random().Next(0, _knownValues.Length)];
            var result = RoadSegmentMorphology.CanParse(value);

            Assert.True(result);
        }
예제 #2
0
        public void CanParseReturnsExpectedResultWhenValueIsUnknown()
        {
            var value  = _fixture.Create <string>();
            var result = RoadSegmentMorphology.CanParse(value);

            Assert.False(result);
        }
예제 #3
0
        public void TryParseReturnsExpectedResultWhenValueIsUnknown()
        {
            var value  = _fixture.Create <string>();
            var result = RoadSegmentMorphology.TryParse(value, out RoadSegmentMorphology parsed);

            Assert.False(result);
            Assert.Null(parsed);
        }
예제 #4
0
        public void ToStringReturnsExpectedResult()
        {
            var value  = _knownValues[new Random().Next(0, _knownValues.Length)];
            var sut    = RoadSegmentMorphology.Parse(value);
            var result = sut.ToString();

            Assert.Equal(value, result);
        }
예제 #5
0
        public void TryParseReturnsExpectedResultWhenValueIsWellKnown()
        {
            var value  = _knownValues[new Random().Next(0, _knownValues.Length)];
            var result = RoadSegmentMorphology.TryParse(value, out RoadSegmentMorphology parsed);

            Assert.True(result);
            Assert.NotNull(parsed);
            Assert.Equal(value, parsed.ToString());
        }
예제 #6
0
 public void CanParseValueCanNotBeNull()
 {
     Assert.Throws <ArgumentNullException>(() => RoadSegmentMorphology.CanParse(null));
 }
예제 #7
0
        public void ParseReturnsExpectedResultWhenValueIsUnknown()
        {
            var value = _fixture.Create <string>();

            Assert.Throws <FormatException>(() => RoadSegmentMorphology.Parse(value));
        }
예제 #8
0
        public void ParseReturnsExpectedResultWhenValueIsWellKnown()
        {
            var value = _knownValues[new Random().Next(0, _knownValues.Length)];

            Assert.NotNull(RoadSegmentMorphology.Parse(value));
        }