Beispiel #1
0
        public void Test_AddVenue_AddsVenueToBand()
        {
            //Arrange
            Band testBand = new Band("reo", "rock");

            testBand.Save();

            Venue testVenue1 = new Venue("Rose Quarter", "Portland", 20000);

            testVenue1.Save();

            Venue testVenue2 = new Venue("Moda", "mars", 10000);

            testVenue2.Save();

            //Act
            testBand.AddVenue(testVenue1);
            testBand.AddVenue(testVenue2);

            List <Venue> result   = testBand.GetVenue();
            List <Venue> testList = new List <Venue> {
                testVenue1, testVenue2
            };

            //Assert
            Assert.Equal(testList, result);
        }
Beispiel #2
0
        public void Delete_DeletesVenueAssociationsFromDatabase_VenueList()
        {
            //Arrange
            Venue testVenue = new Venue("Rose Quarter", "Portland", 20000);

            testVenue.Save();

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

            testBand.Save();


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

            List <Venue> resultBandVenue = testBand.GetVenue();
            List <Venue> testBandVenue   = new List <Venue> {
            };

            //Assert
            Assert.Equal(testBandVenue, resultBandVenue);
        }
Beispiel #3
0
        public void UpdateVenue_OneBand_BandAndNewVenue()
        {
            Band testBand1 = new Band("band");

            testBand1.Save();

            Venue testVenue1 = new Venue("ven1");

            testVenue1.Save();

            Venue testVenue2 = new Venue("ven2");

            testVenue2.Save();

            testBand1.AddVenue(testVenue1.GetId());
            testBand1.UpdateVenue(testVenue1, testVenue2);

            List <Venue> allVenues = testBand1.GetVenue();
            List <Venue> expected  = new List <Venue> {
                testVenue2
            };

            Assert.Equal(expected, allVenues);
        }