Exemplo n.º 1
0
        public void GetPeselMonthShiftedByYear_gets_month_for_PESEL_according_to_year()
        {
            var testCaseData = new[] {
                new { Date = new DateTime(1900, 1, 1), ExpectedMonth = "01" },
                new { Date = new DateTime(1999, 1, 1), ExpectedMonth = "01" },
                new { Date = new DateTime(2000, 1, 1), ExpectedMonth = "21" },
                new { Date = new DateTime(2099, 1, 1), ExpectedMonth = "21" },
                new { Date = new DateTime(2100, 1, 1), ExpectedMonth = "41" },
                new { Date = new DateTime(2199, 1, 1), ExpectedMonth = "41" },
                new { Date = new DateTime(2200, 1, 1), ExpectedMonth = "61" },
                new { Date = new DateTime(2299, 1, 1), ExpectedMonth = "61" },
            };

            foreach (var testCase in testCaseData)
            {
                string month = PeselGenerator.GetPeselMonthShiftedByYear(testCase.Date);

                Assert.AreEqual(
                    testCase.ExpectedMonth,
                    month,
                    string.Format("Failed for date: [{0}], expected month: [{1}] but was [{2}]", testCase.Date, testCase.ExpectedMonth, month));
            }
        }
Exemplo n.º 2
0
 public void GetPeselMonthShiftedByYear_is_supported_to_year_2299()
 {
     PeselGenerator.GetPeselMonthShiftedByYear(new DateTime(2300, 1, 1));
 }
Exemplo n.º 3
0
 public void GetPeselMonthShiftedByYear_is_supported_from_year_1900()
 {
     PeselGenerator.GetPeselMonthShiftedByYear(new DateTime(1899, 1, 1));
 }