コード例 #1
0
        public void GetEventTest()
        {
            EventCRUD eventService = new EventCRUD(new TestDataRepository());

            eventService.AddEvent(17, DateTime.Now, false, 72, 4, 3);
            Assert.AreEqual(eventService.GetEvent(17).Amount, 72);
            eventService.DeleteEvent(17);
        }
コード例 #2
0
        public void AddEventTest()
        {
            EventCRUD eventService = new EventCRUD(new TestDataRepository());

            Assert.IsTrue(eventService.AddEvent(1, DateTime.Now, true, 6, 1, 2));

            Assert.IsTrue(eventService.DeleteEvent(1));
        }
コード例 #3
0
        public void GetAllEventsTest()
        {
            EventCRUD eventService = new EventCRUD(new TestDataRepository());

            eventService.AddEvent(1, DateTime.Now, false, 10, 1, 1);

            IEnumerable <EventDTO> events = eventService.GetAllEvents();

            Assert.AreEqual(events.Count(), 1);
            Assert.AreEqual(events.ElementAt(0).Id, 1);

            eventService.DeleteEvent(1);
        }