public void CanParseReturnsExpectedResultWhenValueIsWellKnown()
        {
            var value  = _knownValues[new Random().Next(0, _knownValues.Length)];
            var result = EuropeanRoadNumber.CanParse(value);

            Assert.True(result);
        }
        public void CanParseReturnsExpectedResultWhenValueIsUnknown()
        {
            var value  = _fixture.Create <string>();
            var result = EuropeanRoadNumber.CanParse(value);

            Assert.False(result);
        }
        public void TryParseReturnsExpectedResultWhenValueIsUnknown()
        {
            var value  = _fixture.Create <string>();
            var result = EuropeanRoadNumber.TryParse(value, out var parsed);

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

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

            Assert.True(result);
            Assert.NotNull(parsed);
            Assert.Equal(value, parsed.ToString());
        }
 public void CanParseValueCanNotBeNull()
 {
     Assert.Throws <ArgumentNullException>(() => EuropeanRoadNumber.CanParse(null));
 }
        public void ParseReturnsExpectedResultWhenValueIsUnknown()
        {
            var value = _fixture.Create <string>();

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

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