Esempio n. 1
0
        public void GetAll_DatabaseEmptyAtFirst_ZeroOutput()
        {
            //Arrange, Act
            int result = Venue.GetAll().Count;

            //Assert
            Assert.Equal(0, result);
        }
Esempio n. 2
0
        public void Venue_Delete_RemoveObjectFromDatabase()
        {
            Venue testVenue = new Venue("Manhattan Square");

            testVenue.Save();

            testVenue.DeleteThis();

            Assert.Equal(0, Venue.GetAll().Count);
        }
Esempio n. 3
0
        public static Dictionary <string, object> ModelMaker()
        {
            Dictionary <string, object> model = new Dictionary <string, object>
            {
                { "Bands", Band.GetAll() },
                { "Venues", Venue.GetAll() },
            };

            return(model);
        }
Esempio n. 4
0
        public void Venue_Save_NoSaveOnDuplicateVenue()
        {
            Venue testVenue = new Venue("Manhattan Square");

            testVenue.Save();
            Venue secondVenue = new Venue("Manhattan Square");

            secondVenue.Save();

            Assert.Equal(1, Venue.GetAll().Count);
        }
Esempio n. 5
0
        public void Save_SavesToDVenueAltersLocalObject_ReturnsNewIdentity()
        {
            // This test will check to see the save functionality for venue works, to test that the program is writing to the database and assigning a new unique Id
            // arrange
            Venue newVenue = new Venue("Fire");

            // act
            newVenue.Save();

            // assert
            Assert.Equal(newVenue, Venue.GetAll()[0]);
        }
Esempio n. 6
0
        public void Save_DoesNotSaveDuplicate_NoAdditionalVenues()
        {
            // This test will check to see the save functionality for venue works, to test that the program is writing to the database and assigning a new unique Id
            // arrange
            Venue newVenue       = new Venue("Fire");
            Venue duplicateVenue = new Venue("Fire");

            // act
            newVenue.Save();
            duplicateVenue.Save();

            // assert
            Assert.Equal(1, Venue.GetAll().Count);
        }
Esempio n. 7
0
        public void Save_OneVenue_VenueSavedWithCorrectID()
        {
            //Arrange
            Venue testVenue = new Venue("Manhattan Square");

            testVenue.Save();
            Venue savedVenue = Venue.GetAll()[0];

            //Act
            int output = savedVenue.GetId();
            int verify = testVenue.GetId();

            //Assert
            Assert.Equal(verify, output);
        }
Esempio n. 8
0
        public void Save_OneVenue_VenueSavedToDatabase()
        {
            //Arrange
            Venue testVenue = new Venue("Manhattan Square");

            //Act
            testVenue.Save();
            List <Venue> output = Venue.GetAll();
            List <Venue> verify = new List <Venue> {
                testVenue
            };

            //Assert
            Assert.Equal(verify, output);
        }
Esempio n. 9
0
        public void Delete_RemoveFromDatabase_DecrementDatabase()
        {
            // This test will check to see if the delete functionality of the program can successfully remove items from the database
            // arrange
            Venue newVenue = new Venue("Fire");

            newVenue.Save();
            Venue otherVenue = new Venue("Water");

            otherVenue.Save();

            // act
            newVenue.Delete();

            // assert
            Assert.Equal(1, Venue.GetAll().Count);
        }
Esempio n. 10
0
        public void SaveGetAll_ManyVenues_ReturnListOfVenues()
        {
            //Arrange
            Venue venueOne = new Venue("Manhattan Square");

            venueOne.Save();
            Venue venueTwo = new Venue("Central Park");

            venueTwo.Save();

            //Act
            List <Venue> output = Venue.GetAll();
            List <Venue> verify = new List <Venue> {
                venueOne, venueTwo
            };

            //Assert
            Assert.Equal(verify, output);
        }
Esempio n. 11
0
 public void Venue_DatabaseStartsEmpty_NothingInDatabase()
 {
     // This test will check to see if the database starts empty and the Dipsose method is working correctly
     // arrange act assert
     Assert.Equal(0, Venue.GetAll().Count);
 }