Exemplo n.º 1
0
        public void IsChecksumCorrect_PeselIncorrect_ReturnsFalse()
        {
            PeselDataReader reader = new PeselDataReader("970213041");

            var result = reader.IsChecksumCorrect();

            Assert.IsFalse(result);
        }
Exemplo n.º 2
0
        public void GetGender_PeselIncorrect_ReturnsUnknowGender()
        {
            PeselDataReader reader = new PeselDataReader("9903200801");

            var result = reader.GetGender();

            Assert.AreEqual(result, Gender.Unknown);
        }
Exemplo n.º 3
0
        public void GetGender_PeselCorrect_ReturnsFemaleGender()
        {
            PeselDataReader reader = new PeselDataReader("97021308041");

            var result = reader.GetGender();

            Assert.AreEqual(result, Gender.Female);
        }
Exemplo n.º 4
0
        public void GetBirthDate_DateCorrect_ReturnsNotNull()
        {
            PeselDataReader reader = new PeselDataReader("99032008031");

            var result = reader.GetBirthDate();

            Assert.IsNotNull(result);
        }
Exemplo n.º 5
0
        public void GetBirthDate_PeselIncorrect_ReturnsNull()
        {
            PeselDataReader reader = new PeselDataReader("990316080");

            var result = reader.GetBirthDate();

            Assert.IsNull(result);
        }
Exemplo n.º 6
0
        public void IsCorrect_NotNumeric_ReturnsFalse()
        {
            PeselDataReader reader = new PeselDataReader("12t33123125");

            var result = reader.IsCorrect();

            Assert.IsFalse(result);
        }
Exemplo n.º 7
0
        public void IsChecksumCorrect_ChecksumCorrect_ReturnsTrue()
        {
            PeselDataReader reader = new PeselDataReader("97021308031");

            var result = reader.IsChecksumCorrect();

            Assert.IsTrue(result);
        }
Exemplo n.º 8
0
        public void IsCorrect_IncorrectLenght_ReturnsFalse()
        {
            PeselDataReader reader = new PeselDataReader("123456");

            var result = reader.IsCorrect();

            Assert.IsFalse(result);
        }