예제 #1
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);
        }
예제 #2
0
        private void EstablishedOutingsList()
        {
            DateTime date1    = new DateTime(2018, 5, 18);
            DateTime date2    = new DateTime(2018, 7, 6);
            DateTime date3    = new DateTime(2018, 12, 15);
            DateTime date4    = new DateTime(2019, 5, 19);
            DateTime date5    = new DateTime(2019, 8, 1);
            DateTime date6    = new DateTime(2019, 10, 3);
            DateTime date7    = new DateTime(2019, 12, 17);
            DateTime date8    = new DateTime(2020, 5, 20);
            Outings  outings1 = new Outings(OutingType.Golf, 76, date1, 22);
            Outings  outings2 = new Outings(OutingType.Bowling, 121, date2, 14.50);
            Outings  outings3 = new Outings(OutingType.Concert, 175, date3, 8);
            Outings  outings4 = new Outings(OutingType.Bowling, 101, date4, 14.25);
            Outings  outings5 = new Outings(OutingType.Amusement_Park, 126, date5, 35.75);
            Outings  outings6 = new Outings(OutingType.Bowling, 115, date6, 16);
            Outings  outings7 = new Outings(OutingType.Concert, 125, date7, 8.75);
            Outings  outings8 = new Outings(OutingType.Golf, 27, date8, 18);

            _outingsRepo.AddOutingToList(outings1);
            _outingsRepo.AddOutingToList(outings2);
            _outingsRepo.AddOutingToList(outings3);
            _outingsRepo.AddOutingToList(outings4);
            _outingsRepo.AddOutingToList(outings5);
            _outingsRepo.AddOutingToList(outings6);
            _outingsRepo.AddOutingToList(outings7);
            _outingsRepo.AddOutingToList(outings8);
        }
예제 #3
0
        public void OutingRepository_GetTotalCost_ShouldReturnTotalCost()
        {
            //Arrange
            List <Outings> outingsList = _outingsRepository.GetOutingsList();

            Outings outings = new Outings();

            outings.TotalCostEvent = 1000m;
            _outingsRepository.AddOutingsToList(outings);

            Outings outingsTwo = new Outings();

            outingsTwo.TotalCostEvent = 500m;
            _outingsRepository.AddOutingsToList(outingsTwo);

            Outings outingsThree = new Outings();

            outingsThree.TotalCostEvent = 250m;
            _outingsRepository.AddOutingsToList(outingsThree);

            //Act
            decimal actual   = _outingsRepository.GetTotalCost();
            decimal expected = 1750m;

            //Assert
            Assert.AreEqual(expected, actual);
        }
예제 #4
0
        public void OutingRepository_GetOutingCostByTypeTwo_ShouldReturnCostByType()
        {
            //Arrange
            Outings outings = new Outings();

            outings.TypeOfEvent    = EventType.Golf;
            outings.TotalCostEvent = 500m;
            _outingsRepository.AddOutingsToList(outings);

            Outings outingsTwo = new Outings();

            outingsTwo.TypeOfEvent    = EventType.Bowling;
            outingsTwo.TotalCostEvent = 250m;
            _outingsRepository.AddOutingsToList(outingsTwo);

            Outings outingsThree = new Outings();

            outingsThree.TypeOfEvent    = EventType.Golf;
            outingsThree.TotalCostEvent = 550m;
            _outingsRepository.AddOutingsToList(outingsThree);

            //Act
            decimal actual   = _outingsRepository.GetOutingsCostByType(EventType.Bowling);
            decimal expected = 250m;

            //Assert
            Assert.AreEqual(expected, actual);
        }
예제 #5
0
        public bool CreateNewOuting()
        {
            Console.Clear();

            Outings newEvent = new Outings();
            
            Console.WriteLine("How many attendees were there?");
            newEvent.attendeesAmount = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("Which event was it?\n" +
                    "1. Golf\n" +
                    "2. Bowling\n" +
                    "3. Amusement Park\n" +
                    "4. Concert");
            newEvent.Type = (EventType) Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("What was the date of the event? Please enter in (mm-dd-yyyy) format");
            newEvent.Date = Convert.ToDateTime(Console.ReadLine());

            Console.WriteLine("What was the cost per person?");
            newEvent.PersonCost = Convert.ToDouble(Console.ReadLine());

                Console.WriteLine("How much was the total cost?");
            newEvent.EventCost = Convert.ToDouble(Console.ReadLine());

            _outings.CreateNewOuting(newEvent);


        }
예제 #6
0
        private void AddOutings()
        {
            Console.Clear();
            Outings addNewOutings = new Outings();

            Console.WriteLine("What is the event type? Golf = 1, bowling 2, amusment park 3, concert 4");
            string eventAsString = Console.ReadLine();
            int    eventAsInt    = Convert.ToInt32(eventAsString);

            addNewOutings.EventType = (EventType)eventAsInt;
            Console.WriteLine("What is the number of attendance");
            string attendanceAsString = Console.ReadLine();
            int    attendanceAsInt    = Convert.ToInt32(attendanceAsString);

            addNewOutings.Attendance = attendanceAsInt;
            Console.WriteLine("Date of Outing");
            string dateAsString = Console.ReadLine();
            int    dateAsInt    = Convert.ToInt32(dateAsString);

            addNewOutings.Date = new DateTime(dateAsInt);
            Console.WriteLine("Cost Per Person");
            string costPersonAsString = Console.ReadLine();
            double costPersonAsDoule  = Convert.ToDouble(costPersonAsString);

            addNewOutings.CostPerPerson = costPersonAsDoule;
            Console.WriteLine("Cost Per Event");
            string costPerEventAsString = Console.ReadLine();
            double costPerEventAsDouble = Convert.ToDouble(costPerEventAsString);

            addNewOutings.CostPerEvent = costPerEventAsDouble;
        }
예제 #7
0
        public void AddNewOuting()
        {
            Console.WriteLine("Create new outing: \n");
            Outings newOuting = new Outings();

            Console.WriteLine("Enter date of Outings: mm/dd/yyyy");
            newOuting.DateOfOuting = DateTime.Parse(Console.ReadLine());
            Console.WriteLine("Choose type of outing: \n" +
                              "1. Amusement Park\n" +
                              "2. Bowling\n" +
                              "3. Concert\n" +
                              "4. Golf");
            int response = int.Parse(Console.ReadLine());

            newOuting.EventType = (TypeOfEvent)response;

            Console.WriteLine("Enter total cost of event: ");
            newOuting.CostForEvent = decimal.Parse(Console.ReadLine());
            Console.WriteLine("Enter number of people attending: ");
            newOuting.NumberOfPeople = int.Parse(Console.ReadLine());
            Console.WriteLine("Enter cost per person attending: ");
            newOuting.CostPerPerson = decimal.Parse(Console.ReadLine());
            _outingsRepo.CreateOuting(newOuting);
            Console.WriteLine("New Outing created and added to list.\n" +
                              "Press any key to return to menu...");

            Console.ReadKey();
        }
예제 #8
0
        // #2 on menu
        private void CreateNewOuting()
        {
            Clear();
            Outings newOuting = new Outings();

            WriteLine("\nEnter the Outing Type Number:\n" +
                      "1. Golf\n" +
                      "2. Bowling\n" +
                      "3. Amusement Park\n" +
                      "4. Concert\n");

            int outingTypeInt = Int32.Parse(ReadLine());

            newOuting.OutingType = (OutingType)outingTypeInt;

            WriteLine("\nEnter the Date of the Outing (mm/dd/yy):");
            newOuting.DateOfEvent = ReadLine();

            WriteLine("\nEnter the Number of People Attending:");
            newOuting.NumOfPeople = Int32.Parse(ReadLine());

            WriteLine("\nEnter the Cost Per Person of the Event:");
            newOuting.CostPerPerson = Int32.Parse(ReadLine());

            _outingsRepo.AddOutingsToList(newOuting);
        }
예제 #9
0
        public void Arrange()
        {
            _repo    = new OutingsRepo();
            _outings = new Outings("JulyGolf", OutingType.Golf, 30, DateTime.Parse("7/13/2020"), 100.00);

            _repo.AddOuting(_outings);
        }
예제 #10
0
        public void AddOutingToList()
        {
            Outings           outings = new Outings();
            OutingsRepository repo    = new OutingsRepository();

            repo.SeedList();
        }
예제 #11
0
        public void ViewOutingsByFinalTypeCost()
        {
            Outings           outings = new Outings();
            OutingsRepository repo    = new OutingsRepository();

            repo.SeedList();
        }
예제 #12
0
        public void TestMethod1()
        {
            _outingsRepo = new OutingsRepository();
            _outings     = new Outings(DateTime.Parse("5/5/2019"), 27, 17, 459, TypeOfEvent.AmusementPark);

            _outingsRepo.CreateOuting(_outings);
        }
예제 #13
0
        public void AddOutingToList()
        {
            Console.WriteLine("What type of outing is this?\n" +
                              "1. Golf\n" +
                              "2. Bowling\n" +
                              "3. Amusement Park\n" +
                              "4. Concert\n");
            string     typeOfOutingAsString = Console.ReadLine();
            int        typeOfOutingAsInt    = int.Parse(typeOfOutingAsString);
            OutingType typeOfOuting         = (OutingType)typeOfOutingAsInt;

            Console.WriteLine("How many people are attending this outing?");
            string numberOfAttendeesAsString = Console.ReadLine();
            int    numberOfAttendees         = int.Parse(numberOfAttendeesAsString);

            Console.WriteLine("Enter the date of the outing as DD/MM/YYYY: ");
            string   dateOfOutingAsString = Console.ReadLine();
            DateTime dateOfOuting         = DateTime.Parse(dateOfOutingAsString);

            Console.WriteLine("What is the cost per attendee?");
            string  totalCostPerAttendeeAsString = Console.ReadLine();
            decimal totalCostPerAttendee         = decimal.Parse(totalCostPerAttendeeAsString);

            Outings newOuting = new Outings(typeOfOuting, numberOfAttendees, dateOfOuting, totalCostPerAttendee);

            _repo.AddOutingToList(newOuting);
        }
        public void AddOutingToDirectory_ShouldReturnTrue()
        {
            Outings      outing    = new Outings();
            Outings_Repo repo      = new Outings_Repo();
            bool         addResult = repo.AddOutingToDirectory(outing);

            Assert.IsTrue(addResult);
        }
예제 #15
0
 private void DisplayContent(Outings outing)
 {
     Console.WriteLine($"Event type: {outing.EventType}");
     Console.WriteLine($"People Attended: {outing.PeopleAttended}");
     Console.WriteLine($"Date: {outing.Date}");
     Console.WriteLine($"Cost per person: ${outing.CostPerPerson}");
     Console.WriteLine($"Event cost: ${outing.EventCost}");
 }
        public void Arrange()
        {
            _repo = new OutingsRepository();
            DateTime date1 = new DateTime(2020, 5, 17);

            _outings = new Outings(OutingType.Golf, 76, date1, 22);
            _repo.AddOutingToList(_outings);
        }
        public void UpdateExistingOuting_ShouldReturnTrue()
        {
            DateTime date1        = new DateTime(2020, 5, 17);
            Outings  updateOuting = new Outings(OutingType.Golf, 72, date1, 22);
            bool     updateResult = _repo.UpdateExistingOuting(OutingType.Golf, date1, updateOuting);

            Assert.IsTrue(updateResult);
        }
예제 #18
0
        private void SeedMenu()
        {
            Outings outings      = new Outings(DateTime.Parse("5/5/2019"), 27, 1, 30, TypeOfEvent.AmusementPark);
            Outings outingsTwo   = new Outings(DateTime.Parse("3/6/2019"), 27, 17, 459, TypeOfEvent.Concert);
            Outings outingsThree = new Outings(DateTime.Parse("1/20/2019"), 27, 8, 300, TypeOfEvent.Golf);

            _outingsRepo.CreateOuting(outings);
            _outingsRepo.CreateOuting(outingsTwo);
            _outingsRepo.CreateOuting(outingsThree);
        }
예제 #19
0
        //Set content
        private void SetContent()
        {
            Outings outing1 = new Outings(OutingType.AmusementPark, 35, "6/15/2021", 0, 1000);
            Outings outing2 = new Outings(OutingType.Bowling, 10, "7/15/2021", 0, 100);
            Outings outing3 = new Outings(OutingType.Concert, 50, "8/31/2021", 0, 300);

            _outingsRepo.AddOutingsToList(outing1);
            _outingsRepo.AddOutingsToList(outing2);
            _outingsRepo.AddOutingsToList(outing3);
        }
        public void OutingsRepository_AddToCostList_ShouldIncreaseCountByOne()
        {
            Outings royalPin = new Outings(EventType.Bowling, 15, "6/23/2018", 23.00m, 345.0m);

            _totalCostList.AddToCostList(royalPin.TotalEventCost);

            var actual   = _totalCostList.GetDecimalList().Count;
            var expected = 1;

            Assert.AreEqual(expected, actual);
        }
예제 #21
0
        public void Challenge1_OutingsRepo_ShouldReturnQueuewithCount1()
        {
            Outings one = new Outings((Event)1, 10, "01/22/2018", 20, 200);

            outRepo.AddOutingToList(one);

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

            Assert.AreEqual(actual, expected);
        }
예제 #22
0
        public void CreateNewOuting_ShouldGetCorrectBool()
        {
            //Arrange
            Outings     newOuting = new Outings();
            OutingsRepo repo      = new OutingsRepo();
            //Act
            bool createOuting = repo.CreateNewOuting(newOuting);

            //Assert
            Assert.IsTrue(createOuting);
        }
예제 #23
0
        public void UpdateExistingOuting_ShouldReturnTrue()
        {
            //Arrange
            Outings newOuting = new Outings("JulyGolf", OutingType.Golf, 30, DateTime.Parse("7/13/2020"), 100.00);

            //Act
            bool updateResult = _repo.UpdateOuting("JulyGolf", newOuting);

            //Assert
            Assert.IsTrue(updateResult);
        }
        public void AddOutingToList_ShouldGetNotNull()
        {
            DateTime          date2      = new DateTime(2020, 6, 04);
            Outings           newOuting  = new Outings(OutingType.Bowling, 123, date2, 17.25);
            OutingsRepository repository = new OutingsRepository();

            repository.AddOutingToList(newOuting);
            Outings contentFromList = repository.GetOutingByTypeDate(OutingType.Bowling, date2);

            Assert.IsNotNull(contentFromList);
        }
예제 #25
0
    public void Challenge3Q()
    {
        Outings one = new Outings((Event)4, 13, "07/13/1986", 777, 1);

        oRepo.AddOutingToList(one);

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

        Assert.AreEqual(actual, expected);
    }
예제 #26
0
        public void SetOutingName_ShouldSetCorrectName()
        {
            Outings outing = new Outings();

            outing.OutingName = "JulyGolf";

            string exp = "JulyGolf";
            string act = outing.OutingName;

            Assert.AreEqual(exp, act);
        }
예제 #27
0
        public void SeedContent()
        {
            Outings julyGolf        = new Outings("JulyGolf", OutingType.Golf, 30, DateTime.Parse("7/13/20"), 100.00);
            Outings marchBowling    = new Outings("MarchBowling", OutingType.Bowling, 25, DateTime.Parse("3/20/20"), 20.00);
            Outings augustAmusement = new Outings("AugustAmusement", OutingType.AmusementPark, 20, DateTime.Parse("8/22/20"), 150.00);
            Outings decemberConcert = new Outings("DecemberConcert", OutingType.Concert, 10, DateTime.Parse("12/15/20"), 75);

            _outingsRepo.AddOuting(julyGolf);
            _outingsRepo.AddOuting(marchBowling);
            _outingsRepo.AddOuting(augustAmusement);
            _outingsRepo.AddOuting(decemberConcert);
        }
예제 #28
0
        private void AddOutings()
        {
            Console.Clear();

            Outings newOuting = new Outings();

            Console.WriteLine("Select an event type.");
            Console.WriteLine("1. Golf");
            Console.WriteLine("2. Bowling");
            Console.WriteLine("3. Amusement Park");
            Console.WriteLine("4. Concert");

            string inputAsString = Console.ReadLine();
            int inputAsInt = int.Parse(inputAsString);

            newOuting.EventType = (EventType)inputAsInt;

            Console.WriteLine("Enter the number of People that attended.");
            string peopleAsString = Console.ReadLine();
            int peopleAsInt = int.Parse(peopleAsString);
            newOuting.PeopleAttended = peopleAsInt;

            Console.WriteLine("Enter the date of the event. (Jan 1, 2020)";
            string dateAsString = Console.ReadLine();
            var date = DateTime.Parse(dateAsString);
            newOuting.Date = date;

            Console.WriteLine("Enter the cost per person");
            string personCostAsString = Console.ReadLine();
            double personCost = double.Parse(personCostAsString);
            newOuting.CostPerPerson = personCost;

            Console.WriteLine("Enter the cost of the event.");
            string eventCostAsString = Console.ReadLine();
            double eventCost = double.Parse(eventCostAsString);
            newOuting.EventCost = eventCost;


            bool wasAdded = _repo.AddOutingsToList(newOuting);
            if (wasAdded == true)
            {
                Console.WriteLine("Outing was successfully added to the List.");
            }
            else
            {
                Console.WriteLine("Unable to add outing to the list.");
            }

            Console.ReadLine();



        }
예제 #29
0
    public void Challenge1_OutingsRepo_TABT()
    {
        Outings one = new Outings((Event)4, 13, "07/13/1986", 777, 1);
        Outings two = new Outings((Event)4, 13, "07/13/1986", 777, 1);

        oRepo.AddOutingToList(one);
        oRepo.AddOutingToList(two);

        var actual   = oRepo.TotalAllOutingsByType((Event)4);
        var expected = 2;

        Assert.AreEqual(actual, expected);
    }
        public void GetOutingsList_ShouldReturnList()
        {
            Outings      outing = new Outings();
            Outings_Repo repo   = new Outings_Repo();

            repo.AddOutingToDirectory(outing);

            List <Outings> contents = repo.GetOutingsList();

            bool hasContent = contents.Contains(outing);

            Assert.IsTrue(hasContent);
        }