Esempio n. 1
0
        public void Parse_GivenHyphantedShortPartNumber_ReturnsOkay()
        {
            var result = PartNumber.Parse(HyphenatedShortPN);

            Assert.True(result.IsOkay);
            Assert.True(result.Contains(new PartNumber(ShortPN)));
        }
Esempio n. 2
0
        public void Parse_GivenPartNumber_ReturnsOkay()
        {
            var result = PartNumber.Parse(LongPN);

            Assert.True(result.IsOkay);
            Assert.True(result.Contains(new PartNumber(LongPN)));
        }
Esempio n. 3
0
        public void Parse_RemanPartNumber_IsCaseInvariant()
        {
            var upper = PartNumber.Parse("20R1234");
            var lower = PartNumber.Parse("20r1234");

            Assert.Equal(upper, lower);
        }
Esempio n. 4
0
        public void Parse_AlphanumericPartNumber_IsCaseInvariant()
        {
            var upper = PartNumber.Parse("1A2345");
            var lower = PartNumber.Parse("1a2345");

            Assert.Equal(upper, lower);
        }
Esempio n. 5
0
        public void Parse_GivenUntrimmedPartNumber_ReturnsOkay()
        {
            var result = PartNumber.Parse("  1234567  ");

            Assert.True(result.IsOkay);
            Assert.True(result.Contains(new PartNumber("1234567")));
        }
Esempio n. 6
0
        public void Parse_GivenWrongHyphenation2_ReturnsError()
        {
            var result = PartNumber.Parse("1234-567");

            Assert.True(result.IsError);
        }
Esempio n. 7
0
        public void Parse_GivenNotAPartNumber_ReturnsError()
        {
            var result = PartNumber.Parse("not a part");

            Assert.True(result.IsError);
        }
Esempio n. 8
0
        public void Parse_GivenEmptyString_ReturnsError()
        {
            var result = PartNumber.Parse(string.Empty);

            Assert.True(result.IsError);
        }
Esempio n. 9
0
        public void Parse_RemanPartNumberWithPunctuation2_IsOkay()
        {
            var result = PartNumber.Parse("20R1234");

            Assert.Equal("20R1234", result.ValueOrThrow());
        }
Esempio n. 10
0
        public void Parse_ShortPartNumberWithPunctuation_IsOkay()
        {
            var result = PartNumber.Parse(":1A2345.");

            Assert.Equal("1A2345", result.ValueOrThrow());
        }
Esempio n. 11
0
        public void Parse_GivenNull_ReturnsError()
        {
            var result = PartNumber.Parse(null);

            Assert.True(result.IsError);
        }
Esempio n. 12
0
        public void Parse_LongPartNumberWithPunctuation_IsOkay()
        {
            var result = PartNumber.Parse(":1234567.");

            Assert.Equal("1234567", result.ValueOrThrow());
        }
Esempio n. 13
0
        public void Parse_GivenShortRemanPartNumber_IsOkay()
        {
            var result = PartNumber.Parse("0r1234");

            Assert.Equal("0R1234", result.ValueOrThrow());
        }
Esempio n. 14
0
        public void Parse_GivenLetterOtherThanR_ReturnsError()
        {
            var result = PartNumber.Parse("20B1234");

            Assert.True(result.IsError);
        }
Esempio n. 15
0
        public void Parse_GivenTooLongRemanPartNumber_ReturnsError()
        {
            var result = PartNumber.Parse("  20R12345  ");

            Assert.True(result.IsError);
        }
Esempio n. 16
0
        public void Parse_GivenTooLongShortPartNumber_ReturnsError()
        {
            var result = PartNumber.Parse("  1A23456  ");

            Assert.True(result.IsError);
        }