Ejemplo n.º 1
0
        public void NassYearReturnsCorrectValue([Values("0023456789",
                                                        "0000000000",
                                                        "993456789",
                                                        "152346789",
                                                        "453388445",
                                                        "871087654",
                                                        "998765432")]
                                                string input,
                                                [Values("00",
                                                        "00",
                                                        "99",
                                                        "15",
                                                        "45",
                                                        "87",
                                                        "99")]
                                                string years)
        {
            //Lets test the year string, ensuring the years array matches that of the input array
            //Test will reply with true
            var sut2   = new Nass(input);
            var actual = sut2.YearPart;

            Assert.AreEqual(actual,
                            years);
        }
Ejemplo n.º 2
0
        public void NassIsNotNull()
        {
            var sut2 = new Nass("12ABC12");

            Assert.That(_sut,
                        Is.Not.Null,
                        "Null with empty constructor");
            Assert.That(sut2,
                        Is.Not.Null,
                        "Null with single constructor");
        }
Ejemplo n.º 3
0
        public void NassSensibleIdReturnsValidTrue([Values("150312345",
                                                           "220119876",
                                                           "450953254",
                                                           "991204856")]
                                                   string input)
        {
            //Now lets test to ensure the sensible options [between 1 and 12]
            var sut2   = new Nass(input);
            var actual = sut2.IsEcsValid();

            Assert.AreEqual(actual,
                            true);
        }
Ejemplo n.º 4
0
        public void NassNotAllNumericReturnsValidFalse([Values("123456 89",
                                                               "0000.0000",
                                                               "1e345g789",
                                                               "abcdefghi")]
                                                       string input)
        {
            //Expected false as not all of the characters are a numeric value
            var sut2   = new Nass(input);
            var actual = sut2.IsEcsValid();

            Assert.AreEqual(false,
                            actual);
        }
Ejemplo n.º 5
0
        public void NassMonthOutOfRangeReturnValidFalse([Values("000000000",
                                                                "001300000",
                                                                "009900000",
                                                                "151632452",
                                                                "994319584")]
                                                        string input)
        {
            // Lets test to ensure that the months aren't less than 1 or more than 12
            var sut2   = new Nass(input);
            var actual = sut2.IsEcsValid();

            Assert.AreEqual(actual,
                            false);
        }
Ejemplo n.º 6
0
        public void NassNot9CharsReturnsValidFalse([Values("12345678",
                                                           "1234567890",
                                                           "",
                                                           " ",
                                                           "!£$%^&*(){",
                                                           "ABCDEFGH")]
                                                   string input)
        {
            //Expected false as there aren't exactly 9 characters
            var sut2   = new Nass(input);
            var actual = sut2.IsEcsValid();

            Assert.AreEqual(false,
                            actual);
        }
Ejemplo n.º 7
0
        public void NassNumberPartReturnsCorretValue([Values("0023456789",
                                                             "998765432",
                                                             "000000000",
                                                             "010112345")]
                                                     string input,
                                                     [Values("456789",
                                                             "65432",
                                                             "00000",
                                                             "12345")]
                                                     string lastChars)
        {
            //Lets test the final 5 characters, ensuing the lastChars array matches that of the input array
            //Test will reply with true
            var sut2   = new Nass(input);
            var actual = sut2.NumberPart;

            Assert.AreEqual(actual,
                            lastChars);
        }
Ejemplo n.º 8
0
        public void NassMonthReturnsCorrectValue([Values("0023456789",
                                                         "993456789",
                                                         "152346789",
                                                         "453388445",
                                                         "871087654")]
                                                 string input,
                                                 [Values("23",
                                                         "34",
                                                         "23",
                                                         "33",
                                                         "10")]
                                                 string months)
        {
            //Lets test the month string, ensuring the months array matches that of the input array
            //Test will reply with true
            var sut2   = new Nass(input);
            var actual = sut2.MonthPart;

            Assert.AreEqual(actual,
                            months);
        }
Ejemplo n.º 9
0
 public void Setup() => _sut = new Nass();