Exemplo n.º 1
0
        public void AddEventTest()
        {
            string commandline = "talk by Dr. Lim at 4pm thur alarm 3pm"; // TODO: Initialize to an appropriate value
            NewUi.EventInfo info = new NewUi.EventInfo(); // TODO: Initialize to an appropriate value
            NewUi.EventInfo infoExpected = new NewUi.EventInfo(); // TODO: Initialize to an appropriate value
            bool expected = true; // TODO: Initialize to an appropriate value
            bool actual;
            actual = Parser.AddEvent(commandline, ref info);

            Assert.AreEqual(info.eventName, "talk by Dr. Lim");
            Assert.AreEqual(info.startDate.DayOfWeek, DayOfWeek.Thursday);
            Assert.AreEqual(info.endDate.DayOfWeek, DayOfWeek.Thursday);
            Assert.AreEqual(info.startTime, new DateTime(1, 1, 1, 16, 0, 0));
            Assert.AreEqual(info.endTime, new DateTime(1, 1, 1, 16, 0, 0));
            Assert.AreEqual(info.urgent, false);
            Assert.AreEqual(info.alarm, true);
            Assert.AreEqual(info.alarmTime, new DateTime(info.endDate.Year,info.endDate.Month,info.endDate.Day, 15, 0, 0));
            Assert.AreEqual(info.freeDay, false);
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }
Exemplo n.º 2
0
        public void EditEventTest()
        {
            string commandline = "edit 0 lala project meeting 13/12 9pm"; // TODO: Initialize to an appropriate value
            string commandline1 = "project meeting 12/12 6pm";
            NewUi ui = new NewUi();
            ui.ProcessCommandline(commandline1);

            int index = 0; // TODO: Initialize to an appropriate value
            int indexExpected = 0; // TODO: Initialize to an appropriate value
            NewUi.EventInfo info = new NewUi.EventInfo(); // TODO: Initialize to an appropriate value
            NewUi.EventInfo infoExpected = new NewUi.EventInfo(); // TODO: Initialize to an appropriate value
            bool expected = false; // TODO: Initialize to an appropriate value
            bool actual;
            actual = Parser.EditEvent(commandline, ref index, ref info);
            Assert.AreEqual(indexExpected, index);
            Assert.AreEqual(infoExpected, info);
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }