예제 #1
0
            private void SeedContent()
            {
                C4_Outings One = new C4_Outings(
                    EventType.Golf,
                    56,
                    DateTime.Now,
                    4999.95
                    );
                C4_Outings Two = new C4_Outings(
                    EventType.Golf,
                    42,
                    DateTime.Now,
                    4242.42
                    );
                C4_Outings Three = new C4_Outings(
                    EventType.Concert,
                    56,
                    DateTime.Now,
                    4747.47
                    );
                C4_Outings Four = new C4_Outings(
                    EventType.Concert,
                    39,
                    DateTime.Now,
                    3939.39
                    );
                C4_Outings Five = new C4_Outings(
                    EventType.Bowling,
                    11,
                    DateTime.Now,
                    1111.11
                    );
                C4_Outings Six = new C4_Outings(
                    EventType.Bowling,
                    22,
                    DateTime.Now,
                    2222.22
                    );
                C4_Outings Seven = new C4_Outings(
                    EventType.Amusement_Park,
                    11,
                    DateTime.Now,
                    3333.33
                    );
                C4_Outings Eight = new C4_Outings(
                    EventType.Amusement_Park,
                    22,
                    DateTime.Now,
                    4444.44
                    );

                repo.AddEventToList(One);
                repo.AddEventToList(Two);
                repo.AddEventToList(Three);
                repo.AddEventToList(Four);
                repo.AddEventToList(Five);
                repo.AddEventToList(Six);
                repo.AddEventToList(Seven);
                repo.AddEventToList(Eight);
            }
예제 #2
0
 public void ShowOuting(C4_Outings outing)
 {
     Console.WriteLine($"Event Type: {outing.EventType}");
     Console.WriteLine($"Number Attended: {outing.NumberAttended}");
     Console.WriteLine($"Date of Event: {outing.DateOfEvent}");
     Console.WriteLine($"Total Event Cost: {outing.TotalEventCost}");
     Console.WriteLine($"Total Cost Per Person: {outing.TotalCostPerPerson}");
 }
예제 #3
0
        private void AddItemsToMenu_ShouldGetCorrectBoolean()
        {
            //Arrange
            C4Repo     repo   = new C4Repo();
            C4_Outings outing = new C4_Outings();
            //Act
            bool addResult = repo.AddEventToList(outing);

            //Assert
            Assert.IsTrue(addResult);
        }
예제 #4
0
            private void AddNewEvent()
            {
                C4_Outings newOuting = new C4_Outings();

                Console.Clear();
                Console.WriteLine("Enter the number of the event type you would like to add:\n" +
                                  "1. Golf\n" +
                                  "2. Concert\n" +
                                  "3. Bowling\n" +
                                  "4. Amusement Park\n");
                string eventType   = Console.ReadLine();
                bool   stopRunning = false;

                while (!stopRunning)
                {
                    switch (eventType)
                    {
                    case "1":
                        newOuting.EventType = EventType.Golf;
                        stopRunning         = true;
                        break;

                    case "2":
                        newOuting.EventType = EventType.Concert;
                        stopRunning         = true;
                        break;

                    case "3":
                        newOuting.EventType = EventType.Bowling;
                        stopRunning         = true;
                        break;

                    case "4":
                        newOuting.EventType = EventType.Amusement_Park;
                        stopRunning         = true;
                        break;

                    default:
                        Console.WriteLine("Please enter a valid input.");
                        stopRunning = false;
                        break;
                    }
                }
                Console.WriteLine("Please enter th number of people that attended the event.");
                newOuting.NumberAttended = Int32.Parse(Console.ReadLine());
                Console.WriteLine("Enter date of event in format MM/DD/YYYY: ");
                newOuting.DateOfEvent = DateTime.Parse(Console.ReadLine());
                Console.WriteLine("Please enter the Total cost of the event.");
                newOuting.TotalEventCost = double.Parse(Console.ReadLine());

                bool wasAdded = repo.AddEventToList(newOuting);

                if (wasAdded == true)
                {
                    Console.WriteLine("Your content was succesfully added.");
                }
                else
                {
                    Console.WriteLine("Oops something went wrong. Your content was not added.");
                }
            }