Пример #1
0
        public void AddEventsToList()
        {
            OutingRepository _outingRepo = new OutingRepository();
            Outing           item1       = new Outing();
            Outing           item2       = new Outing();
            Outing           item3       = new Outing();

            _outingRepo.AddEventToList(item1);
            _outingRepo.AddEventToList(item2);
            _outingRepo.AddEventToList(item3);

            int actual   = _outingRepo.GetEventList().Count;
            int expected = 3;

            Assert.AreEqual(expected, actual);
        }
Пример #2
0
        public void OutingRepo_Add()
        {
            // Arrange
            OutingRepository _outingRepo = new OutingRepository();
            Outing           item1       = new Outing(10, DateTime.Today, 25, 250, EventType.Golf);
            Outing           item2       = new Outing(15, DateTime.Today, 20, 300, EventType.Golf);

            // Act
            _outingRepo.AddEventToList(item1);
            _outingRepo.AddEventToList(item2);
            List <Outing> ItemList = _outingRepo.GetEventList();

            decimal expected = 550;
            decimal actual   = _outingRepo.AllEventTotalCost(ItemList);

            // Assert
            Assert.AreEqual(expected, actual);
        }
Пример #3
0
        public void OutingRepo_GetList()
        {
            // Arrange
            OutingRepository _outingRepo = new OutingRepository();
            Outing           item1       = new Outing();

            // Act
            _outingRepo.AddEventToList(item1);
            List <Outing> ItemList = _outingRepo.GetEventList();

            bool expected = true;
            bool actual   = ItemList.Contains(item1);

            // Assert
            Assert.AreEqual(expected, actual);
        }