Пример #1
0
        public void CheckOnNonModyfing_NonOfThen()
        {
            var      synchronizer = new Syncronizator();
            var      calendarA    = new CalendarServiceStub();
            var      calendarB    = new CalendarServiceStub();
            DateTime startData    = DateTime.Now;
            DateTime finishDate   = startData.AddMonths(1);

            synchronizer.ApplyAllUpdates(startData, finishDate, new List <ICalendarService> {
                calendarA, calendarB
            });

            Assert.True(calendarA.GetAllItems(startData, finishDate).Count == calendarB.GetAllItems(startData, finishDate).Count &&
                        calendarB.GetAllItems(startData, finishDate).Count == 0);
        }
Пример #2
0
        public void NeedToDelete_Deleted()
        {
            var      synchronizer = new Syncronizator();
            var      calendarA    = new CalendarServiceStub();
            var      calendarB    = new CalendarServiceStub();
            DateTime startData    = DateTime.Now;

            calendarA.AddEvent(new SynchronEvent().SetId("1234").SetStart(DateTime.Now).SetFinish(DateTime.Now.AddDays(1))
                               .SetPlacement("1").SetSource("2"));
            DateTime finishDate = startData.AddMonths(1);

            synchronizer.ApplyAllUpdates(startData, finishDate, new List <ICalendarService> {
                calendarA, calendarB
            });

            Assert.True(calendarA.GetAllItems(startData, finishDate).Count == calendarB.GetAllItems(startData, finishDate).Count &&
                        calendarB.GetAllItems(startData, finishDate).Count == 0);
        }
Пример #3
0
        public void NeedToUpdate_Updated()
        {
            var      synchronizer = new Syncronizator();
            var      calendarA    = new CalendarServiceStub();
            var      calendarB    = new CalendarServiceStub();
            DateTime startData    = DateTime.Now;
            DateTime finishDate   = startData.AddMonths(1);
            var      curEvent     = new SynchronEvent().SetId("1234").SetStart(startData.AddMinutes(15)).SetFinish(finishDate)
                                    .SetPlacement("1").SetSource("2");

            calendarA.AddEvent(curEvent);
            calendarB.AddEvent(curEvent.SetPlacement("2").SetSubject("check"));


            synchronizer.ApplyAllUpdates(startData, finishDate, new List <ICalendarService> {
                calendarA, calendarB
            });

            Assert.True(calendarA.GetAllItems(startData, finishDate)[0].GetSubject() == "check");
        }