Beispiel #1
0
        public void Test_AddBand_AddsBandToVenue()
        {
            //Arrange
            Venue testVenue = new Venue("Rose Quarter", "Portland", 20000);

            testVenue.Save();

            Band testBand = new Band("reo", "rock");

            testBand.Save();

            Band testBand2 = new Band("journey", "rock");

            testBand2.Save();

            //Act
            testVenue.AddBand(testBand);
            testVenue.AddBand(testBand2);

            List <Band> result   = testVenue.GetBand();
            List <Band> testList = new List <Band> {
                testBand, testBand2
            };

            //Assert
            Assert.Equal(testList, result);
        }
        public void Test_AddBand_AddsBandToVenue()
        {
            //Arrange
            Venue testVenue = new Venue("The Wiltern, Los Angeles, CA");

            testVenue.Save();

            Band testBand1 = new Band("Paramore");

            testBand1.Save();

            Band testBand2 = new Band("Oh Wonder");

            testBand2.Save();

            //Act
            testVenue.AddBand(testBand1);
            testVenue.AddBand(testBand2);

            List <Band> listOfBandsResults = testVenue.GetBands();
            List <Band> testListOfBands    = new List <Band> {
                testBand1, testBand2
            };

            //Assert
            Assert.Equal(testListOfBands, listOfBandsResults);
        }
Beispiel #3
0
        public void AddBand_AddsBandToVenue()
        {
            //Arrange
            Venue testVenue = new Venue("Tractor Tavern");

            testVenue.Save();

            Band testBand = new Band("The Flaming Lips");

            testBand.Save();

            Band testBand2 = new Band("The Taverns");

            testBand2.Save();

            //Act
            testVenue.AddBand(testBand);
            testVenue.AddBand(testBand2);

            List <Band> result   = testVenue.GetBands();
            List <Band> testList = new List <Band> {
                testBand, testBand2
            };

            //Assert
            Assert.Equal(testList, result);
        }
Beispiel #4
0
        public void Test_RemoveBand_DisassociatesBandFromVenue()
        {
            Venue testVenue1 = new Venue("Staples Center", "Los Angeles, CA");

            testVenue1.Save();

            Band band1 = new Band("Some Band Name", "Some Band Description");

            band1.Save();

            Band band2 = new Band("Some Band Name", "Some Band Description");

            band2.Save();

            Band band3 = new Band("Some Band Name", "Some Band Description");

            band3.Save();

            testVenue1.AddBand(band1);
            testVenue1.AddBand(band2);
            testVenue1.AddBand(band3);

            testVenue1.RemoveBand(band2);

            List <Band> result   = testVenue1.GetBands();
            List <Band> expected = new List <Band> {
                band1, band3
            };

            Assert.Equal(expected, result);
        }
Beispiel #5
0
        public void Test_AddBand_AddsBandToVenue()
        {
            //Arrange
            Venue testVenue = new Venue("Cameo");

            testVenue.Save();

            Band testBand = new Band("Yoshis");

            testBand.Save();
            Band testBand2 = new Band("House of Blues");

            testBand2.Save();

            //Act
            testVenue.AddBand(testBand);
            testVenue.AddBand(testBand2);

            List <Band> result   = testVenue.GetBands();
            List <Band> testList = new List <Band> {
                testBand, testBand2
            };

            //Assert
            Assert.Equal(testList, result);
        }
Beispiel #6
0
        public void Venue_AddBand_AddsBandToVenue()
        {
            //Arrange
            Venue testVenue = new Venue("Name");

            testVenue.Save();

            Band testBand = new Band("Band name");

            testBand.Save();

            Band testBand2 = new Band("Other band name");

            testBand2.Save();

            //Act
            testVenue.AddBand(testBand);
            testVenue.AddBand(testBand2);

            List <Band> result   = testVenue.GetBands();
            List <Band> testList = new List <Band> {
                testBand, testBand2
            };

            //Assert
            Assert.Equal(testList, result);
        }
Beispiel #7
0
        public void Test_GetUnrelatedVenues_ReturnsListOfUnassociatedVenues()
        {
            Venue testVenue1 = new Venue("Staples Center", "Los Angeles, CA");

            testVenue1.Save();

            Venue testVenue2 = new Venue("Staples Center", "Los Angeles, CA");

            testVenue2.Save();

            Band band1 = new Band("Some Band Name", "Some Band Description");

            band1.Save();

            Band band2 = new Band("Some Band Name", "Some Band Description");

            band2.Save();

            Band band3 = new Band("Some Band Name", "Some Band Description");

            band3.Save();

            testVenue1.AddBand(band1);
            testVenue2.AddBand(band2);

            List <Band> result   = testVenue1.GetUnrelatedBands();
            List <Band> expected = new List <Band> {
                band2, band3
            };

            Assert.Equal(expected, result);
        }
Beispiel #8
0
        public void Test_GetBands_ReturnsAllVenueBands()
        {
            //Arrange
            Venue testVenue = new Venue("Name");

            testVenue.Save();

            Band testBand1 = new Band("Other object name");

            testBand1.Save();

            Band testBand2 = new Band("Another object name");

            testBand2.Save();

            //Act
            testVenue.AddBand(testBand1);
            List <Band> result   = testVenue.GetBands();
            List <Band> testList = new List <Band> {
                testBand1
            };

            //Assert
            Assert.Equal(testList, result);
        }
Beispiel #9
0
        public void Test_GetBands_ReturnsAllVenuesBands()
        {
            //Arrange
            Venue testVenue = new Venue("Gorge");

            testVenue.Save();

            Band testBand1 = new Band("Radiohead");

            testBand1.Save();

            Band testBand2 = new Band("Fleetwood Mac");

            testBand2.Save();

            //Act
            testVenue.AddBand(testBand1);
            List <Band> result   = testVenue.GetBands();
            List <Band> testList = new List <Band> {
                testBand1
            };

            //Assert
            Assert.Equal(testList, result);
        }
Beispiel #10
0
        public void Test_GetBands_ReturnsAllVenueBands()
        {
            //Arrange
            Venue testVenue = new Venue("Meany Hall");

            testVenue.Save();

            Band testBand1 = new Band("Pentatonix", "Pop", "Problem");

            testBand1.Save();

            Band testBand2 = new Band("Evanescence", "Rock", "Bring Me To Life");

            testBand2.Save();

            //Act
            testVenue.AddBand(testBand1);
            List <Band> result   = testVenue.GetBands();
            List <Band> testList = new List <Band> {
                testBand1
            };

            //Assert
            Assert.Equal(testList, result);
        }
        public void Test_GetBands_ReturnsAllVenueBands()
        {
            //Arrange
            Venue testVenue = new Venue("Roseland Theater");

            testVenue.Save();

            Band testBand1 = new Band("ColdPlay");

            testBand1.Save();

            Band testBand2 = new Band("Metallica");

            testBand2.Save();

            //Act
            testVenue.AddBand(testBand1);
            List <Band> result   = testVenue.GetBands();
            List <Band> testList = new List <Band> {
                testBand1
            };

            //Assert
            Assert.Equal(testList, result);
        }
Beispiel #12
0
        public void GetBands_ReturnsAllVenueBands_bandList()
        {
            //Arrange
            Venue testVenue = new Venue("Hilton Lounge", "Beaverton, OR");

            testVenue.Save();

            Band testBand1 = new Band("Jazzo Band", "Jazz");

            testBand1.Save();

            Band testBand2 = new Band("Rocky Band", "Rock");

            testBand2.Save();

            //Act
            testVenue.AddBand(testBand1);
            List <Band> result   = testVenue.GetBands();
            List <Band> testList = new List <Band> {
                testBand1
            };

            //Assert
            Assert.Equal(testList, result);
        }
Beispiel #13
0
 public void Test_AddBand_AddsBandToVenue()
 {
     //Arrange
       Venue testVenue = new Venue("El Corazon");
       testVenue.Save();
       Band testBand = new Band("The Loud Mouths");
       testBand.Save();
       Band testBand2 = new Band("The People With Guitars ");
       testBand2.Save();
       //Act
       testVenue.AddBand(testBand);
       testVenue.AddBand(testBand2);
       List<Band> result = testVenue.GetBands();
       List<Band> testList = new List<Band>{testBand, testBand2};
       //Assert
       Assert.Equal(testList, result);
 }
Beispiel #14
0
        public void Venue_DeleteBands_DeletesAllOfVenuesBands()
        {
            Venue venue = new Venue("Providence Park", 10000);

            venue.Save();
            Band band1 = new Band("Maroon5");

            band1.Save();
            Band band2 = new Band("Rammstein");

            band2.Save();

            venue.AddBand(band1, new DateTime(2013, 04, 19));
            venue.AddBand(band2, new DateTime(2013, 04, 19));
            venue.DeleteBands();

            List <Band> testList    = venue.GetBands();
            List <Band> controlList = new List <Band> {
            };

            Assert.Equal(controlList, testList);
        }
Beispiel #15
0
        public void Test_AddBand_AddsBandToVenue()
        {
            //Arrange
            Venue testVenue = new Venue("El Corazon");

            testVenue.Save();
            Band testBand = new Band("The Loud Mouths");

            testBand.Save();
            Band testBand2 = new Band("The People With Guitars ");

            testBand2.Save();
            //Act
            testVenue.AddBand(testBand);
            testVenue.AddBand(testBand2);
            List <Band> result   = testVenue.GetBands();
            List <Band> testList = new List <Band> {
                testBand, testBand2
            };

            //Assert
            Assert.Equal(testList, result);
        }
        public void Test_AddBand_AddsBandToVenue()
        {
            Band testBand = new Band("Frets on Fire");
              testBand.Save();
              Venue testVenue = new Venue("Shatter Dome");
              testVenue.Save();

              testVenue.AddBand(testBand);

              List<Band> testList = new List<Band>{testBand};
              List<Band> result = testVenue.GetBands();

              Assert.Equal(testList, result);
        }
Beispiel #17
0
        public void Venue_DeleteBandRelationship_DeletesRelationship()
        {
            Venue venue = new Venue("ModaCenter", 5000);

            venue.Save();
            Band band1 = new Band("Maroon5");

            band1.Save();
            Band band2 = new Band("Rammstein");

            band2.Save();

            venue.AddBand(band1, new DateTime(2013, 04, 19));
            venue.AddBand(band2, new DateTime(2013, 04, 19));
            venue.DeleteBandRelationship(band1);

            List <Band> testList    = venue.GetBands();
            List <Band> controlList = new List <Band> {
                band2
            };

            Assert.Equal(controlList, testList);
        }
Beispiel #18
0
        public void AddBand_VenueAndBand_AllVenueBands()
        {
            Band newBand1 = new Band("CCR");

            newBand1.Save();
            Band newBand2 = new Band("B52s");

            newBand2.Save();

            Venue newVenue1 = new Venue("Radio City Music Hall");

            newVenue1.Save();

            newVenue1.AddBand(newBand1.GetId());
            newVenue1.AddBand(newBand2.GetId());

            List <Band> allBandsVenue1 = newVenue1.GetBands();
            List <Band> expected       = new List <Band> {
                newBand1, newBand2
            };

            Assert.Equal(expected, allBandsVenue1);
        }
        public void Test_GetBands_RetrievesAllBandsInVenue()
        {
            //Arrange
            Venue testVenue = new Venue("Gator Lounge");

            testVenue.Save();
            Band firstBand = new Band("Nirvana");

            firstBand.Save();
            Band secondBand = new Band("Cake");

            secondBand.Save();

            //Act
            testVenue.AddBand(firstBand);
            testVenue.AddBand(secondBand);
            List <Band> testBandList = new List <Band> {
                firstBand, secondBand
            };
            List <Band> resultBandList = testVenue.GetBands();

            //Assert
            Assert.Equal(testBandList, resultBandList);
        }
Beispiel #20
0
        public void Test7_AddsBandToVenue()
        {
            Venue testVenue = new Venue("skydome");

            testVenue.Save();

            Band testBand1 = new Band("The Doors");

            testBand1.Save();

            Band testBand2 = new Band("Nirvana");

            testBand2.Save();

            testVenue.AddBand(testBand1);
            testVenue.AddBand(testBand2);

            List <Band> result   = testVenue.GetBands();
            List <Band> testList = new List <Band> {
                testBand1, testBand2
            };

            Assert.Equal(testList, result);
        }
Beispiel #21
0
        public void Test_GetBands_RetrievesAllBandsInVenue()
        {
            //Arrange
            Venue testVenue = new Venue("Red Rocks");

            testVenue.Save();
            Band firstBands = new Band("Angry Fish");

            firstBands.Save();
            Band secondBands = new Band("Angry Fish");

            secondBands.Save();

            //Act
            testVenue.AddBand(firstBands);
            testVenue.AddBand(secondBands);
            List <Band> testBandsList = new List <Band> {
                firstBands, secondBands
            };
            List <Band> resultBandsList = testVenue.GetBands();

            //Assert
            Assert.Equal(testBandsList, resultBandsList);
        }
Beispiel #22
0
        public void GetVenues_RetrievesVenuesOfAGivenBand()
        {
            Band newBand = new Band("Wilco");

            newBand.Save();
            Venue newVenue = new Venue("CBGB");

            newVenue.Save();
            newVenue.AddBand(newBand);
            List <Venue> expected = new List <Venue> {
                newVenue
            };
            List <Venue> result = newBand.GetVenues();

            Assert.Equal(expected, result);
        }
Beispiel #23
0
        public void GetBands_RetrievesBandsOfAGivenVenue()
        {
            Band newBand = new Band("Wilco");

            newBand.Save();
            Venue newVenue = new Venue("CBGB");

            newVenue.Save();
            newVenue.AddBand(newBand);
            List <Band> expected = new List <Band> {
                newBand
            };
            List <Band> result = newVenue.GetBands();

            Assert.Equal(expected, result);
        }
Beispiel #24
0
        public void Test_GetBands_ReturnAllBandsInVenue()
        {
            // Arragne
            firstVenue.Save();
            firstBand.Save();

            // Act
            firstVenue.AddBand(firstBand);
            List <Band> savedBand = firstVenue.GetBands();
            List <Band> testList  = new List <Band> {
                firstBand
            };

            // Assert
            Assert.Equal(testList, savedBand);
        }
Beispiel #25
0
        public void TEST_AddBandToVenueRelationship()
        {
            Venue testVenue = new Venue("El Corozon");

            testVenue.Save();
            Band testBand = new Band("Mayday Parade");

            testBand.Save();

            testVenue.AddBand(testBand);
            List <Band> bandsAtVenue = new List <Band> {
                testBand
            };

            Assert.Equal(bandsAtVenue, testVenue.GetBands());
        }
Beispiel #26
0
        public void AddBand_AddsBandToVenue_True()
        {
            Band newBand = new Band("Wilco");

            newBand.Save();
            Venue newVenue = new Venue("CBGB");

            newVenue.Save();
            newVenue.AddBand(newBand);
            List <Band> expected = new List <Band> {
                newBand
            };
            List <Band> result = newVenue.GetBands();

            Assert.Equal(expected, result);
        }
Beispiel #27
0
        public void AddGetBand_BandObject_BandVenueSavedInJoinTable()
        {
            Venue testVenue = new Venue("THE SPACE");

            testVenue.Save();
            Band testBand = new Band("Rocket");

            testBand.Save();
            testVenue.AddBand(testBand);

            List <Band> output   = testVenue.GetBands();
            List <Band> expected = new List <Band> {
                testBand
            };

            Assert.Equal(expected, output);
        }
        public void AddBand_AddsBandToVenue_True()
        {
            Venue newVenue = new Venue("Crystal Ballroom");

            newVenue.Save();
            Band newBand = new Band("Black Keys");

            newBand.Save();

            newVenue.AddBand(newBand);
            List <Band> expected = new List <Band> {
                newBand
            };
            List <Band> result = newVenue.GetBands();

            Assert.Equal(expected, result);
        }
        public void Delete_DeletesAssociation_True()
        {
            Venue newVenue = new Venue("Crystal Ballroom");

            newVenue.Save();
            Band newBand = new Band("Black Keys");

            newVenue.Save();
            newVenue.AddBand(newBand);
            newVenue.Delete();

            List <Band> result   = newVenue.GetBands();
            List <Band> expected = new List <Band> {
            };

            Assert.Equal(expected, result);
        }
Beispiel #30
0
        public void Venue_AddBand_AssignsBandToVenue()
        {
            Venue newVenue = new Venue("Modacenter", 5000);

            newVenue.Save();
            Band newBand = new Band("Maroon5");

            newBand.Save();
            Console.WriteLine(newBand.Id);

            newVenue.AddBand(newBand, new DateTime(2016, 05, 21));
            List <Band> testList    = newVenue.GetBands();
            List <Band> controlList = new List <Band> {
                newBand
            };

            Assert.Equal(controlList, testList);
        }
Beispiel #31
0
        public void Test_DeleteVenue_DeleteVenueFromJoinTable()
        {
            //Arrange
            Venue testVenue = new Venue("THE SPACE");

            testVenue.Save();
            Band testBand = new Band("Rocket");

            testBand.Save();
            testVenue.AddBand(testBand);
            //Act
            testVenue.Delete();
            List <Venue> expected = new List <Venue> {
            };
            List <Venue> actual   = testBand.GetVenues();

            Assert.Equal(expected, actual);
        }
Beispiel #32
0
        public void Test_GetBands_ReturnsAllVenueBands()
        {
            Venue testVenue = new Venue("Staples Center", "Los Angeles, CA");

            testVenue.Save();

            Band testBand = new Band("Some Band Name", "Some Band Description");

            testBand.Save();

            testVenue.AddBand(testBand);

            List <Band> savedBand = testVenue.GetBands();
            List <Band> expected  = new List <Band> {
                testBand
            };

            Assert.Equal(expected, savedBand);
        }
        public void Test_GetBands_ReturnsAllBandBands()
        {
            Venue testVenue = new Venue("Shatter Dome");
              testVenue.Save();
              Band testBand1 = new Band("Frets on Fire");
              testBand1.Save();
              Band testBand2 = new Band("Crimson Typhoon and the Knife Heads");
              testBand2.Save();

              testVenue.AddBand(testBand1);
              testVenue.AddBand(testBand2);

              List<Band> testList = new List<Band> {testBand1, testBand2};
              List<Band> result = testVenue.GetBands();

              Assert.Equal(testList, result);
        }
Beispiel #34
0
        public void Test_AddBand_AddsBandToVenue()
        {
            //Arrange
              Venue testVenue = new Venue("A");
              testVenue.Save();
              DateTime testTime = new DateTime(2016, 1, 1);

              Band testBand = new Band("A",testTime);
              testBand.Save();

              Band testBand2 = new Band("B",testTime);
              testBand2.Save();

              //Act
              testVenue.AddBand(testBand);
              testVenue.AddBand(testBand2);

              List<Band> result = testVenue.GetBands();
              List<Band> testList = new List<Band> {testBand, testBand2};

              Assert.Equal(testList, result);
        }
Beispiel #35
0
        public void Test_Delete_DeletesVenueAssociationsFromDatabase()
        {
            //Arrange
              DateTime testTime = new DateTime(2016, 1, 1);

              Band testBand = new Band("A",testTime);
              testBand.Save();

              string testName = "Home stuff";
              Venue testVenue = new Venue(testName);
              testVenue.Save();

              //Act
              testVenue.AddBand(testBand);
              testVenue.Delete();

              List<Venue> resultBandVenues = testBand.GetVenues();
              List<Venue> testBandVenues = new List<Venue> {};
              List<Band> resultsBands= Band.GetAll();
              List<Band> testBands= new List<Band>{testBand};

              //Assert
              Assert.Equal(testBandVenues, resultBandVenues);
              Assert.Equal(testBands, resultsBands);
        }
Beispiel #36
0
 public void Test_GetBands_ReturnsAllVenueBands()
 {
     //Arrange
       Venue testVenue = new Venue("The Catwalk");
       testVenue.Save();
       Band testBand1 = new Band("The LoudMouths");
       testBand1.Save();
       Band testBand2 = new Band("The NoiseMakers");
       testBand2.Save();
       List<Band> testList = new List<Band> {testBand1};
       //Act
       testVenue.AddBand(testBand1);
       List<Band> savedBands = testVenue.GetBands();
       //Assert
       Assert.Equal(testList, savedBands);
 }
Beispiel #37
0
        public void Test_GetBands_ReturnAllVenueBands()
        {
            Venue testVenue = new Venue("place");
              testVenue.Save();
              DateTime testTime = new DateTime(2016, 1, 1);

              Band testBand1= new Band("A",testTime);
              testBand1.Save();

              Band testBand2 = new Band("C",testTime);
              testBand2.Save();

              testVenue.AddBand(testBand1);
              List<Band> savedBands = testVenue.GetBands();
              List<Band> testList= new List<Band>{testBand1};
              Assert.Equal(testList,savedBands);
        }