Пример #1
0
        public void can_locate_by_name()
        {
            string name = "pt-PT";
            DateTimeCultureInfo workingdayCultureInfo = new DateTimeCultureInfo(name);

            Assert.IsTrue(name == workingdayCultureInfo.Name);
            Assert.IsInstanceOf <PT_PTHolidayStrategy>(workingdayCultureInfo.LocateHolidayStrategy(name));
        }
 public void can_get_strateryies()
 {
     var dateTimeCulture = new DateTimeCultureInfo("ar-SA");
     var holidaysStrategy = dateTimeCulture.LocateHolidayStrategy(dateTimeCulture.Name);
     Assert.AreEqual(typeof(AR_SAHolidayStrategy), holidaysStrategy.GetType());
     var workingDaysStrategy = dateTimeCulture.LocateWorkingDayOfWeekStrategy(dateTimeCulture.Name);
     Assert.AreEqual(typeof(AR_SAWorkingDayOfWeekStrategy), workingDaysStrategy.GetType());
 }
        public void can_locate_default_strategies()
        {
            string name = "foo";
            DateTimeCultureInfo workingdayCultureInfo = new DateTimeCultureInfo(name);

            Assert.IsTrue(name == workingdayCultureInfo.Name);
            Assert.IsInstanceOf <DefaultHolidayStrategy>(workingdayCultureInfo.LocateHolidayStrategy(name));
            Assert.IsInstanceOf <DefaultWorkingDayOfWeekStrategy>(workingdayCultureInfo.LocateWorkingDayOfWeekStrategy(name));
        }
Пример #4
0
        public void can_locate_by_culture_info()
        {
            string name = "pt-PT";

            System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo(name);
            DateTimeCultureInfo workingdayCultureInfo = new DateTimeCultureInfo();

            Assert.IsTrue(name == workingdayCultureInfo.Name);
            Assert.IsInstanceOf <PT_PTHolidayStrategy>(workingdayCultureInfo.LocateHolidayStrategy(name));
        }
 public void can_get_stratery()
 {
     var dateTimeCulture = new DateTimeCultureInfo("fr-CA");
     var strategy = dateTimeCulture.LocateHolidayStrategy(dateTimeCulture.Name);
     Assert.AreEqual(typeof(FR_CAHolidayStrategy),strategy.GetType());
 }