Exemple #1
0
        public void GetExternalRef_Null_ReturnsNull()
        {
            var sut = new CrmReference();

            var actual = sut.NumericValue();

            Assert.That(actual, Is.Null.Or.Empty);
        }
Exemple #2
0
        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));
        }
Exemple #3
0
        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));
        }
Exemple #4
0
        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));
        }