Пример #1
0
        public void CanParseReturnsExpectedResultWhenValueIsUnknown()
        {
            var value  = _fixture.Create <string>();
            var result = RoadSegmentAccessRestriction.CanParse(value);

            Assert.False(result);
        }
Пример #2
0
        public void CanParseReturnsExpectedResultWhenValueIsWellKnown()
        {
            var value  = _knownValues[new Random().Next(0, _knownValues.Length)];
            var result = RoadSegmentAccessRestriction.CanParse(value);

            Assert.True(result);
        }
Пример #3
0
        public void TryParseReturnsExpectedResultWhenValueIsUnknown()
        {
            var value  = _fixture.Create <string>();
            var result = RoadSegmentAccessRestriction.TryParse(value, out RoadSegmentAccessRestriction parsed);

            Assert.False(result);
            Assert.Null(parsed);
        }
Пример #4
0
        public void ToStringReturnsExpectedResult()
        {
            var value  = _knownValues[new Random().Next(0, _knownValues.Length)];
            var sut    = RoadSegmentAccessRestriction.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 = RoadSegmentAccessRestriction.TryParse(value, out RoadSegmentAccessRestriction parsed);

            Assert.True(result);
            Assert.NotNull(parsed);
            Assert.Equal(value, parsed.ToString());
        }
Пример #6
0
 public void CanParseValueCanNotBeNull()
 {
     Assert.Throws <ArgumentNullException>(() => RoadSegmentAccessRestriction.CanParse(null));
 }
Пример #7
0
        public void ParseReturnsExpectedResultWhenValueIsUnknown()
        {
            var value = _fixture.Create <string>();

            Assert.Throws <FormatException>(() => RoadSegmentAccessRestriction.Parse(value));
        }
Пример #8
0
        public void ParseReturnsExpectedResultWhenValueIsWellKnown()
        {
            var value = _knownValues[new Random().Next(0, _knownValues.Length)];

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