public void getcountrywithmostuniqueholidays()
        {
            List <Holiday> result = new List <Holiday>();

            result.Add(new Holiday()
            {
                countryCode = "AD", date = new System.DateTime(2019, 1, 1, 1, 0, 0)
            });
            result.Add(new Holiday()
            {
                countryCode = "AD", date = new System.DateTime(2019, 2, 1, 1, 0, 0)
            });
            result.Add(new Holiday()
            {
                countryCode = "AD", date = new System.DateTime(2019, 3, 1, 1, 0, 0)
            });
            result.Add(new Holiday()
            {
                countryCode = "AR", date = new System.DateTime(2019, 7, 1, 1, 0, 0)
            });
            result.Add(new Holiday()
            {
                countryCode = "AT", date = new System.DateTime(2019, 1, 2, 1, 0, 0)
            });
            result.Add(new Holiday()
            {
                countryCode = "AT", date = new System.DateTime(2019, 1, 3, 1, 0, 0)
            });
            var testresult = HolidayCalc.getcountrywithmostuniqueholidays(result);

            Assert.AreEqual(testresult, "AD");

            result.Add(new Holiday()
            {
                countryCode = "AR", date = new System.DateTime(2019, 2, 3, 1, 0, 0)
            });
            result.Add(new Holiday()
            {
                countryCode = "AR", date = new System.DateTime(2019, 2, 4, 1, 0, 0)
            });
            result.Add(new Holiday()
            {
                countryCode = "AR", date = new System.DateTime(2019, 2, 5, 1, 0, 0)
            });
            result.Add(new Holiday()
            {
                countryCode = "AR", date = new System.DateTime(2019, 2, 6, 1, 0, 0)
            });
            result.Add(new Holiday()
            {
                countryCode = "AR", date = new System.DateTime(2019, 2, 7, 1, 0, 0)
            });
            result.Add(new Holiday()
            {
                countryCode = "AR", date = new System.DateTime(2019, 2, 8, 1, 0, 0)
            });
            testresult = HolidayCalc.getcountrywithmostuniqueholidays(result);
            Assert.AreEqual(testresult, "AR");
        }
Esempio n. 2
0
        public async Task <JsonResult> getcountrywithmostuniqueholidays()
        {
            var date        = await CountrySingleton.Singleton;
            var countrycode = HolidayCalc.getcountrywithmostuniqueholidays(date.reuslt_holiday);


            return(new JsonResult(new { countrycode }));
        }