Exemplo n.º 1
0
        public void CheckCorrectWZone(ScheduleSpec spec, String nowWZone, String expectedWZone)
        {
            var nowDate      = DateTimeParser.ParseDefaultMSecWZone(nowWZone);
            var nowDateJava  = DateTimeOffsetHelper.MillisToJavaMillis(nowDate);
            var expectedDate = DateTimeParser.ParseDefaultMSecWZone(expectedWZone);

            var result = ScheduleComputeHelper.ComputeNextOccurance(spec, nowDate, TimeZoneInfo.Local);

            var resultDate = result.TimeFromMillis(null);

            if (result != expectedDate)
            {
                Log.Debug(".checkCorrect Difference in result found, spec=" + spec);
                Log.Debug(".checkCorrect      now=" + nowDate.ToString(TimeFormat) + " long=" + nowDate);
                Log.Debug(".checkCorrect expected=" + expectedDate.ToString(TimeFormat) + " long=" + expectedDate);
                Log.Debug(".checkCorrect   result=" + resultDate.ToString(TimeFormat) + " long=" + resultDate);
                Assert.Fail();
            }
        }