예제 #1
0
        public void GetAll_DatabaseEmptyAtFirst_ZeroOutput()
        {
            //Arrange, Act
            int result = Band.GetAll().Count;

            //Assert
            Assert.Equal(0, result);
        }
예제 #2
0
        public static Dictionary <string, object> ModelMaker()
        {
            Dictionary <string, object> model = new Dictionary <string, object>
            {
                { "Bands", Band.GetAll() },
                { "Venues", Venue.GetAll() },
            };

            return(model);
        }
예제 #3
0
        public void Band_Delete_RemoveObjectFromDatabase()
        {
            Band testBand = new Band("Green Day");

            testBand.Save();

            testBand.DeleteThis();

            Assert.Equal(0, Band.GetAll().Count);
        }
예제 #4
0
        public void Band_Save_NoSaveOnDuplicateBand()
        {
            Band testBand = new Band("Green Day");

            testBand.Save();
            Band secondBand = new Band("Green Day");

            secondBand.Save();

            Assert.Equal(1, Band.GetAll().Count);
        }
예제 #5
0
        public void Save_OneBand_BandSavedWithCorrectID()
        {
            //Arrange
            Band testBand = new Band("Green Day");

            testBand.Save();
            Band savedBand = Band.GetAll()[0];

            //Act
            int output = savedBand.GetId();
            int verify = testBand.GetId();

            //Assert
            Assert.Equal(verify, output);
        }
예제 #6
0
        public void Save_OneBand_BandSavedToDatabase()
        {
            //Arrange
            Band testBand = new Band("Green Day");

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

            //Assert
            Assert.Equal(verify, output);
        }
예제 #7
0
        public void SaveGetAll_ManyBands_ReturnListOfBands()
        {
            //Arrange
            Band bandOne = new Band("Green Day");

            bandOne.Save();
            Band bandTwo = new Band("Spice Girl");

            bandTwo.Save();

            //Act
            List <Band> output = Band.GetAll();
            List <Band> verify = new List <Band> {
                bandOne, bandTwo
            };

            //Assert
            Assert.Equal(verify, output);
        }