public void Parse_GivenHyphantedShortPartNumber_ReturnsOkay() { var result = PartNumber.Parse(HyphenatedShortPN); Assert.True(result.IsOkay); Assert.True(result.Contains(new PartNumber(ShortPN))); }
public void Parse_GivenPartNumber_ReturnsOkay() { var result = PartNumber.Parse(LongPN); Assert.True(result.IsOkay); Assert.True(result.Contains(new PartNumber(LongPN))); }
public void Parse_RemanPartNumber_IsCaseInvariant() { var upper = PartNumber.Parse("20R1234"); var lower = PartNumber.Parse("20r1234"); Assert.Equal(upper, lower); }
public void Parse_AlphanumericPartNumber_IsCaseInvariant() { var upper = PartNumber.Parse("1A2345"); var lower = PartNumber.Parse("1a2345"); Assert.Equal(upper, lower); }
public void Parse_GivenUntrimmedPartNumber_ReturnsOkay() { var result = PartNumber.Parse(" 1234567 "); Assert.True(result.IsOkay); Assert.True(result.Contains(new PartNumber("1234567"))); }
public void Parse_GivenWrongHyphenation2_ReturnsError() { var result = PartNumber.Parse("1234-567"); Assert.True(result.IsError); }
public void Parse_GivenNotAPartNumber_ReturnsError() { var result = PartNumber.Parse("not a part"); Assert.True(result.IsError); }
public void Parse_GivenEmptyString_ReturnsError() { var result = PartNumber.Parse(string.Empty); Assert.True(result.IsError); }
public void Parse_RemanPartNumberWithPunctuation2_IsOkay() { var result = PartNumber.Parse("20R1234"); Assert.Equal("20R1234", result.ValueOrThrow()); }
public void Parse_ShortPartNumberWithPunctuation_IsOkay() { var result = PartNumber.Parse(":1A2345."); Assert.Equal("1A2345", result.ValueOrThrow()); }
public void Parse_GivenNull_ReturnsError() { var result = PartNumber.Parse(null); Assert.True(result.IsError); }
public void Parse_LongPartNumberWithPunctuation_IsOkay() { var result = PartNumber.Parse(":1234567."); Assert.Equal("1234567", result.ValueOrThrow()); }
public void Parse_GivenShortRemanPartNumber_IsOkay() { var result = PartNumber.Parse("0r1234"); Assert.Equal("0R1234", result.ValueOrThrow()); }
public void Parse_GivenLetterOtherThanR_ReturnsError() { var result = PartNumber.Parse("20B1234"); Assert.True(result.IsError); }
public void Parse_GivenTooLongRemanPartNumber_ReturnsError() { var result = PartNumber.Parse(" 20R12345 "); Assert.True(result.IsError); }
public void Parse_GivenTooLongShortPartNumber_ReturnsError() { var result = PartNumber.Parse(" 1A23456 "); Assert.True(result.IsError); }