Exemple #1
0
        public void CanParseReturnsExpectedResultWhenValueIsUnknown()
        {
            var value  = _fixture.Create <string>();
            var result = GradeSeparatedJunctionType.CanParse(value);

            Assert.False(result);
        }
Exemple #2
0
        public void CanParseReturnsExpectedResultWhenValueIsWellKnown()
        {
            var value  = _knownValues[new Random().Next(0, _knownValues.Length)];
            var result = GradeSeparatedJunctionType.CanParse(value);

            Assert.True(result);
        }
Exemple #3
0
        public void ToStringReturnsExpectedResult()
        {
            var value  = _knownValues[new Random().Next(0, _knownValues.Length)];
            var sut    = GradeSeparatedJunctionType.Parse(value);
            var result = sut.ToString();

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

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

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

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