예제 #1
0
 private void CheckTranslation(VmDailyHours model, DailyOpeningTime target, bool isExtra)
 {
     if (isExtra && model.Extra != DailyHoursExtraTypes.Vissible)
     {
         target.Should().BeNull();
     }
     else
     {
         long timeFrom = isExtra ? model.TimeFromExtra.Value : model.TimeFrom.Value;
         long timeTo   = isExtra ? model.TimeToExtra.Value : model.TimeTo.Value;
         target.DayFrom.Should().Be((int)model.DayFrom);
         target.DayTo.Should().Be((int?)model.DayTo);
         target.From.Should().Be(new TimeSpan((timeFrom % (24 * 3600 * 1000)) * 10000));
         target.To.Should().Be(new TimeSpan((timeTo % (24 * 3600 * 1000)) * 10000));
     }
 }
예제 #2
0
        private void CheckTranslation(DailyOpeningTime model, VmDailyHours target)
        {
            ((int)target.DayFrom).Should().Be(model.DayFrom);
            target.Day.Should().BeTrue();
//            if (model.IsExtra)
//            {
//                target.TimeFromExtra.Should().Be(GetTime(model.From));
//                target.TimeToExtra.Should().Be(GetTime(model.To));
//                target.TimeFrom.Should().Be(0);
//                target.TimeTo.Should().Be(0);
//            }
//            else
//            {
            target.TimeFrom.Should().Be(GetTime(model.From));
            target.TimeTo.Should().Be(GetTime(model.To));
//                target.TimeFromExtra.HasValue.Should().BeFalse();
//                target.TimeToExtra.HasValue.Should().BeFalse();
//            }
        }