public void GetExternalRef_Null_ReturnsNull() { var sut = new CrmReference(); var actual = sut.NumericValue(); Assert.That(actual, Is.Null.Or.Empty); }
public void NumericValue_InvalidNumber( [Values("a1234a", "ab", "£$%^7_")] string crmReference) { var sut = new CrmReference(crmReference); var actual = sut.NumericValue(); Assert.That(actual, Is.Not.Null); Assert.That(actual, Is.EqualTo(string.Empty)); }
public void NumericValue_ExtractsNumber( [Values("1234", "ab123", "£$%^7")] string crmReference, [Values("1234", "123", "7")] string expected) { var sut = new CrmReference(crmReference); var actual = sut.NumericValue(); Assert.That(actual, Is.Not.Null); Assert.That(actual, Is.EqualTo(expected)); }
public void NumericValue_KeepsLeadingZero() { var crmNumber = "012345678901234"; var crmPrefix = "AF"; var crmPostFix = "567"; var crmRef = new CrmReference(crmPrefix + crmNumber + crmPostFix); var expected = crmNumber + crmPostFix; var actual = crmRef.NumericValue(); Assert.That(actual, Is.Not.Null); Assert.That(actual, Is.EqualTo(expected)); }