示例#1
0
    IEnumerator AlarmCheckCoroutine()
    {
        var alarms = AlarmList.Where(x => DateTimeCompare.Compare(x.time, DateTime.Now, x.type));

        foreach (var a in alarms)
        {
            StartCoroutine(CallAlarm(a));
        }
        var returnAlarms = ExecutedAlarm.Where(x => !DateTimeCompare.Compare(x.time, DateTime.Now, x.type));

        foreach (var r in returnAlarms)
        {
            ExecutedAlarm.Remove(r);
            AlarmList.Add(r);
        }
        yield return(new WaitForSeconds(1f));
    }
示例#2
0
    public static int Main()
    {
        DateTimeCompare test = new DateTimeCompare();

        TestLibrary.TestFramework.BeginTestCase("DateTimeCompare");

        if (test.RunTests())
        {
            TestLibrary.TestFramework.EndTestCase();
            TestLibrary.TestFramework.LogInformation("PASS");
            return(100);
        }
        else
        {
            TestLibrary.TestFramework.EndTestCase();
            TestLibrary.TestFramework.LogInformation("FAIL");
            return(0);
        }
    }
示例#3
0
        public static void AreEqual(DateTime expected, DateTime actual, DateTimeCompare compare)
        {
            var comparer = comparers[compare];

            Assert.AreEqual(expected.ToString(comparer), actual.ToString(comparer));
        }
示例#4
0
    public static int Main()
    {
        DateTimeCompare test = new DateTimeCompare();

        TestLibrary.TestFramework.BeginTestCase("DateTimeCompare");

        if (test.RunTests())
        {
            TestLibrary.TestFramework.EndTestCase();
            TestLibrary.TestFramework.LogInformation("PASS");
            return 100;
        }
        else
        {
            TestLibrary.TestFramework.EndTestCase();
            TestLibrary.TestFramework.LogInformation("FAIL");
            return 0;
        }
    }
        public void IsCoveredTest(DateTime baseStart, DateTime baseEnd, DateTime targetStart, DateTime targetEnd, bool expect)
        {
            var actual = DateTimeCompare.IsCovered(baseStart, baseEnd, targetStart, targetEnd);

            Assert.Equal(expect, actual);
        }
 public static void AreEqual(DateTime expected, DateTime actual, DateTimeCompare compare)
 {
     var comparer = comparers[compare];
     Assert.AreEqual(expected.ToString(comparer), actual.ToString(comparer));
 }