Exemplo n.º 1
0
        public void TestWithinRuntime()
        {
            var now = DateTime.Now;

            var before = new DateTime(now.Year, now.Month, now.Day, 1, 0, 0);
            var after  = new DateTime(now.Year, now.Month, now.Day, 23, 0, 0);
            var middle = new DateTime(now.Year, now.Month, now.Day, 10, 0, 0);

            var ni = new NotificationIcon();

            Assert.IsFalse(ni.WithinRuntime(before), "Time is not within limit");
            Assert.IsFalse(ni.WithinRuntime(after), "Time is not within limit");
            Assert.IsTrue(ni.WithinRuntime(middle), "Time is within limit");
        }