public void Arrange()
 {
     _outingRepoTest = new OutingRepository();
     royalPin        = new Outing(EventType.Bowling, 15, "6/23/2018", 23.00m, 345.0m);
     golf            = new Outing(EventType.Golf, 2, "5/05/2018", 35.0m, 70.0m);
     concert         = new Outing(EventType.Concert, 2, "6/23/2018", 15.00m, 30.0m);
 }
Пример #2
0
        public void Outing_CostByEventType_ShouldGetTotalForEventType()
        {
            //-- Arrange
            OutingRepository _outingsRepo = new OutingRepository();
            DateTime         date1        = new DateTime(2018, 4, 25);
            DateTime         date2        = new DateTime(2018, 5, 25);
            DateTime         date3        = new DateTime(2018, 6, 25);
            DateTime         date4        = new DateTime(2018, 7, 25);
            Outings          outing1      = new Outings("Golf", 4, date1, 100.00);
            Outings          outing2      = new Outings("Golf", 4, date2, 80.00);
            Outings          outing3      = new Outings("Amusement Park", 4, date3, 200.00);
            Outings          outing4      = new Outings("Concert", 4, date4, 400.00);

            _outingsRepo.AddOutingToList(outing1);
            _outingsRepo.AddOutingToList(outing2);
            _outingsRepo.AddOutingToList(outing3);
            _outingsRepo.AddOutingToList(outing4);

            //-- Act
            double expected = 180;
            double actual   = _outingsRepo.EventType("Golf");

            //-- Assert
            Assert.AreEqual(expected, actual);
        }
Пример #3
0
        public void OutingRepository_CalculateCostByType_ShouldBeCorrectCost()
        {
            OutingRepository _outingRepo = new OutingRepository();
            Outing           outing      = new Outing();
            Outing           outingTwo   = new Outing();
            Outing           outingThree = new Outing();

            _outingRepo.AddOutingToList(outing);
            _outingRepo.AddOutingToList(outingTwo);
            _outingRepo.AddOutingToList(outingThree);

            outing.TypeOfEvent      = EventType.Golf;
            outingTwo.TypeOfEvent   = EventType.Golf;
            outingThree.TypeOfEvent = EventType.Bowling;

            outing.TotalCost      = 200;
            outingTwo.TotalCost   = 200;
            outingThree.TotalCost = 100;

            decimal actual   = _outingRepo.CalculateCostOfEventType(EventType.Golf);
            decimal expected = 400;

            Assert.AreEqual(expected, actual);

            decimal actualTwo   = _outingRepo.CalculateCostOfEventType(EventType.Bowling);
            decimal expectedTwo = 100;

            Assert.AreEqual(expectedTwo, actualTwo);
        }
Пример #4
0
        public void OutingRepository_CombineOutingByType_ShouldReturnTotalCostByType()
        {
            //-- Assert
            OutingRepository outingRepo = new OutingRepository();

            DateTime renOneDate  = new DateTime(2016, 10, 15);
            DateTime renTwoDate  = new DateTime(2016, 11, 15);
            DateTime concertDate = new DateTime(2017, 04, 03);

            Outing RenOne  = new Outing("Renaissance Festival", 15, renOneDate, 15m);
            Outing RenTwo  = new Outing("Renaissance Festival", 20, renTwoDate, 15m);
            Outing Concert = new Outing("Concert", 10, concertDate, 65m);

            outingRepo.AddOuting(RenOne);
            outingRepo.AddOuting(RenTwo);
            outingRepo.AddOuting(Concert);

            decimal totalbyType = outingRepo.CombineOutingByType("Renaissance Festival");

            //-- Act
            decimal actual   = outingRepo.CombineOutingByType("Renaissance Festival");
            decimal expected = 525m;

            //-- Assert
            Assert.AreEqual(expected, actual);
        }
Пример #5
0
        public static void Main()
        {
            OutingRepository uiRepo = new OutingRepository();
            ProgramUI        ui     = new ProgramUI(uiRepo);

            uiRepo.AddInitialOuting();
            ui.Run();
        }
        public void AddOuting_ShouldReturnCorrectBool()
        {
            Outing           outing     = new Outing();
            OutingRepository outingRepo = new OutingRepository();

            bool outingAdded = outingRepo.AddOuting(outing);

            Assert.IsTrue(outingAdded);
        }
Пример #7
0
        public void Arrange()
        {
            _outingRepo  = new OutingRepository();
            _outingOne   = new Outing(EventType.Golf, 4, DateTime.Parse("03/12/2019"), 15);
            _outingTwo   = new Outing(EventType.Golf, 7, DateTime.Parse("07/23/2019"), 10);
            _outingThree = new Outing(EventType.Bowling, 9, DateTime.Parse("11/05/2018"), 13);

            _outingRepo.AddOuting(_outingOne);
            _outingRepo.AddOuting(_outingTwo);
            _outingRepo.AddOuting(_outingThree);
        }
Пример #8
0
        public void GetTotalCostOfAllEvents_ValidEventCost_ShouldReturnCorrectSum()
        {
            OutingRepository outingRepo = new OutingRepository();

            outingRepo.SeedList();

            decimal expected = 1739900m;
            decimal actual   = outingRepo.GetTotalCostOfAllEvents();

            Assert.AreEqual(expected, actual);
        }
Пример #9
0
        public void AddNewOuting_ReturnsCorrectValue()
        {
            //Arrange
            OutingRepository repo = new OutingRepository();
            int outingTotal       = 0;

            //Act
            repo.AddNewOuting();
            //Assert
            Assert.AreEqual(outingTotal, 1);
        }
Пример #10
0
        public void AddOutingTest()
        {
            OutingRepository oRepo   = new OutingRepository();
            List <Outing>    outings = oRepo.GetOutings();

            Outing test = new Outing(OutingType.Bowling, 50, new DateTime(), 15, 1500);

            oRepo.AddOuting(test);

            Assert.IsTrue(outings.Contains(test));
        }
Пример #11
0
        public void AddOuting_ShouldReturnTrue()
        {
            //Arrange
            OutingRepository outingRepo = new OutingRepository();
            Outing           outing     = new Outing();

            //Act
            bool addSucceeded = outingRepo.AddOuting(outing);

            //Assert
            Assert.IsTrue(addSucceeded);
        }
Пример #12
0
        public void OutingRepository_AddOuting_ShouldReturnListOf1()
        {
            OutingRepository outingRepo = new OutingRepository();
            List <Outing>    testList   = outingRepo.GetList();

            outingRepo.AddOuting(EventType.AmusementPark, 5, DateTime.Today, 5m, 20m);

            var expected = 1;
            var actual   = outingRepo.GetList().Count;

            Assert.AreEqual(expected, actual);
        }
        public void GetAllOutings_ShouldReturnCorrectList()
        {
            Outing           outing     = new Outing();
            OutingRepository outingRepo = new OutingRepository();

            outingRepo.AddOuting(outing);

            List <Outing> outings = outingRepo.GetAllOutings();
            bool          directoryContainsOuting = outings.Contains(outing);

            Assert.IsTrue(directoryContainsOuting);
        }
        public void AddToMenu_ShouldGetCoorectBool()
        {
            //Arrange
            Outing           content = new Outing();
            OutingRepository repo    = new OutingRepository();

            //Act
            bool addResult = repo.AddContentToOutingList(content);

            //Assert
            Assert.IsTrue(addResult);
        }
Пример #15
0
        public void TestAddClaimToQueue()
        {
            Outings outings = new Outings();

            _outingRepo = new OutingRepository();

            _outingRepo.AddOutingToList(outings);

            int expected = 1;
            int actual   = _outingRepo.GetOutingList().Count;

            Assert.AreEqual(expected, actual);
        }
Пример #16
0
        public void OutingRepository_GetCostByType_ShouldReturnTypeTotalCost()
        {
            OutingRepository outingRepo = new OutingRepository();
            List <Outing>    testList   = outingRepo.GetList();

            outingRepo.AddOuting(EventType.AmusementPark, 5, DateTime.Today, 5m, 150m);
            outingRepo.AddOuting(EventType.Bowling, 5, DateTime.Today, 5m, 30m);

            var expected = 150m;
            var actual   = outingRepo.GetCostByType(EventType.AmusementPark);

            Assert.AreEqual(expected, actual);
        }
Пример #17
0
        public void OutingRepository_AddOuting_ShouldReturnCorrectCount()
        {
            //Arrange
            OutingRepository outingRepo = new OutingRepository();
            List <Outing>    testList   = outingRepo.GetList();

            //Act
            outingRepo.AddOuting(EventType.Golf, 5, DateTime.Today, 5m, 20m);
            var expected = 1;
            var actual   = outingRepo.GetList().Count;

            //Assert
            Assert.AreEqual(expected, actual);
        }
Пример #18
0
        public void GetTotalCostByType_ShouldReturnCorrectSum()
        {
            OutingRepository outingrepo = new OutingRepository();


            OutingInfo outing5 = new OutingInfo(EventType.Golf, 34, DateTime.Now, 90.09m, 1043.04m);

            outingrepo.AddTolist(outing5);

            decimal expected = 35463.36m;
            decimal actual   = outingrepo.GetTotalCostOfEventsWithType(EventType.Golf);


            Assert.AreEqual(expected, actual);
        }
        public void GetAllMenuContent_ShouldReturnAllContent()
        {
            //Arrange
            Outing           content = new Outing();
            OutingRepository repo    = new OutingRepository();

            repo.AddContentToOutingList(content);

            //Act
            List <Outing> outing = repo.GetAllOutingInfo();
            bool          result = outing.Contains(content);

            //Assert
            Assert.IsTrue(result);
        }
        public void OutingRepository_StringToDateTime_ShoulReturnDateTime()
        {
            //--Arrange
            OutingRepository _outingRepo = new OutingRepository();

            DateTime date = _outingRepo.StringToDateTime("8/1/2018");


            //--Act
            int actual   = date.Day;
            int expected = 1;

            //--Assert
            Assert.AreEqual(expected, actual);
        }
Пример #21
0
        public void CreateNewOuting_AddToOutings_CountShouldBeTheSame()
        {
            OutingRepository outingrepo = new OutingRepository();

            List <OutingInfo> outing = outingrepo.SeeAllOutings();

            OutingInfo outing5 = new OutingInfo(EventType.Golf, 34, DateTime.Now, 90.09m, 104144.04m);

            outingrepo.AddTolist(outing5);

            int expected = 1;
            int actual   = outing.Count;

            Assert.AreEqual(expected, actual);
        }
Пример #22
0
        public void Outing_AddToList_ShouldAddToList()
        {
            //-- Arrange
            OutingRepository _outingsRepo = new OutingRepository();
            DateTime         date1        = new DateTime(2018, 4, 25);
            Outings          outing1      = new Outings("Golf", 4, date1, 100.00);

            _outingsRepo.AddOutingToList(outing1);

            //-- Act
            int expected = 1;
            int actual   = _outingsRepo.GetCount();

            //-- Assert
            Assert.AreEqual(expected, actual);
        }
Пример #23
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);
        }
Пример #24
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);
        }
Пример #25
0
        public void OutingRepository_AddOuting_ShouldReturnCorrectCount()
        {
            OutingRepository _outingRepo = new OutingRepository();
            Outing           outing      = new Outing();
            Outing           outingTwo   = new Outing();
            Outing           outingThree = new Outing();

            _outingRepo.AddOutingToList(outing);
            _outingRepo.AddOutingToList(outingTwo);
            _outingRepo.AddOutingToList(outingThree);

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

            Assert.AreEqual(expected, actual);
        }
        public void OutingRepository_AddOuting_ShouldReturnList()
        {
            //--Arrange
            OutingRepository _outingRepo = new OutingRepository();
            Outing           outing1     = new Outing(EventTypes.Bowling, 30, _outingRepo.StringToDateTime("7/20/2017"), 1000.40m);

            _outingRepo.AddOutings(outing1);
            List <Outing> outings = _outingRepo.GetOutings();

            //--Act
            int actual   = outings.Count;
            int expected = 1;

            //--Assert
            Assert.AreEqual(expected, actual);
        }
Пример #27
0
        public void GetTotalByTypeTest()
        {
            OutingRepository oRepo   = new OutingRepository();
            List <Outing>    outings = new List <Outing>();

            Outing test  = new Outing(OutingType.Bowling, 50, new DateTime(), 15, 1500);
            Outing test2 = new Outing(OutingType.Golf, 50, new DateTime(), 15, 1500);

            oRepo.AddOuting(test);
            oRepo.AddOuting(test2);

            double expected = 1500;
            double actual   = oRepo.GetTotalByType(OutingType.Golf);

            Assert.AreEqual(expected, actual);
        }
Пример #28
0
        public void Outing_AddToList_ShouldAddToList()
        {
            //arrange
            OutingRepository outingRepo = new OutingRepository();
            Outing           content    = new Outing(EventType.AmusementPark, 5000, new DateTime(12, 12, 12), 15, 75000);

            //act
            outingRepo.AddToList(content);
            List <Outing> list = outingRepo.GetOutingList();

            var actual   = list.Count;
            var expected = 1;

            //assert
            Assert.AreEqual(expected, actual);
        }
Пример #29
0
        public void OutingRepository_AddOutingToList_ShouldReturnCorrectCount()
        {
            //Arrange
            OutingEvent      outing    = new OutingEvent();
            OutingEvent      outingTwo = new OutingEvent();
            OutingRepository repo      = new OutingRepository();

            //Act
            repo.AddOutingToList(outing);
            repo.AddOutingToList(outingTwo);

            int actual   = repo.GetOutingList().Count;
            int expected = 2;

            //Assert
            Assert.AreEqual(expected, actual);
        }
Пример #30
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);
        }