Ejemplo n.º 1
0
        public void CalculateDaysFromADTest_ValidDate(int day, int month, int year, int expected)
        {
            DaysADCounter webService = new DaysADCounter();
            int           result     = webService.CalculateDaysFromAD(day, month, year);

            Assert.AreEqual(expected, result);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("Enter the day: ");
                int day = int.Parse(Console.ReadLine());

                Console.WriteLine("Enter the month: ");
                int month = int.Parse(Console.ReadLine());

                Console.WriteLine("Enter the year: ");
                int year = int.Parse(Console.ReadLine());

                DaysADCounter webServis = new DaysADCounter();
                Console.WriteLine("Count of days from Anno Domini to the entered date: " + webServis.CalculateDaysFromAD(day, month, year));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 3
0
        public void CalculateDaysFromADTest_WrongDate(int day, int month, int year)
        {
            DaysADCounter webService = new DaysADCounter();

            Assert.Throws <FormatException>(() => webService.CalculateDaysFromAD(day, month, year));
        }