示例#1
0
        public void Band_TestBandIsEmptyAtFirst()
        {
            //Arrange, Act
            int result = Band.GetAll().Count;

            Assert.Equal(0, result);
        }
示例#2
0
        public void Test_DatabaseEmptyAtFirst()
        {
            //Arrange, Act
            int result = Band.GetAll().Count;

            //Assert
            Assert.Equal(0, result);
        }
示例#3
0
        public void Band_GetAll_DatabaseEmptyOnload()
        {
            List <Band> testList    = Band.GetAll();
            List <Band> controlList = new List <Band> {
            };

            Assert.Equal(controlList, testList);
        }
        public void GetAll_DatabaseEmpty_true()
        {
            //Arrange
            //Act
            int result = Band.GetAll().Count;

            //Assert
            Assert.Equal(0, result);
        }
示例#5
0
        public static Dictionary <string, object> ModelMaker()
        {
            Dictionary <string, object> model = new Dictionary <string, object> {
            };

            model.Add("bands", Band.GetAll());
            model.Add("venues", Venue.GetAll());
            return(model);
        }
示例#6
0
        public void Delete_RemoveBandFromDatabase_Deleted()
        {
            Band newBand = new Band("Adele");

            newBand.Save();

            Band.Delete(newBand.GetId());

            Assert.Equal(0, Band.GetAll().Count);
        }
示例#7
0
        public void Band_Save_SaveToDatabase()
        {
            Band newBand = new Band("Maroon5");

            newBand.Save();

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

            Assert.Equal(newBand, testBand);
        }
示例#8
0
        public void Save_SaveToDatabase_SaveWithId()
        {
            Band testBand = new Band("THE SPACE");

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

            int result   = savedBand.GetId();
            int expected = testBand.GetId();

            Assert.Equal(expected, result);
        }
示例#9
0
        public void Save_SavesToDb_True()
        {
            //Arrange
            Band newBand = new Band("Misery Jackyls", "3308698686");

            newBand.Save();
            //Act
            List <Band> foundBands = Band.GetAll();

            //Assert
            Assert.Equal(1, foundBands.Count);
        }
        public void Save_SavesBandToDatabase_true()
        {
            //Arrange
            Band newBand = new Band("Sublime");

            //Act
            newBand.Save();
            List <Band> allBands = Band.GetAll();

            //Assert
            Assert.Equal(newBand, allBands[0]);
        }
示例#11
0
        public void Test3_SavesToDatabase()
        {
            Band testBand = new Band("Nirvana");

            testBand.Save();
            List <Band> result   = Band.GetAll();
            List <Band> testList = new List <Band> {
                testBand
            };

            Assert.Equal(testList, result);
        }
示例#12
0
        public void T4_Save_AssignsIdToBand()
        {
            Band testBand = new Band("Brand New");

            testBand.Save();

            Band savedBand = Band.GetAll()[0];
            int  result    = savedBand.GetId();
            int  testId    = testBand.GetId();

            Assert.Equal(testId, result);
        }
示例#13
0
        public void GetAll_ReturnsAllBands_List()
        {
            Band newBand = new Band("Journey");

            newBand.Save();

            List <Band> expectedResult = new List <Band> {
                newBand
            };
            List <Band> actual = Band.GetAll();

            Assert.Equal(expectedResult, actual);
        }
示例#14
0
        public void Test4_SavesIdForBandObject()
        {
            Band testBand = new Band("Nirvana");

            testBand.Save();

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

            int result = savedBand.GetId();
            int testId = testBand.GetId();

            Assert.Equal(testId, result);
        }
示例#15
0
        public void Save_ReturnsBandName_name()
        {
            Band newBand = new Band("Radiohead");

            newBand.Save();

            List <Band> expected = new List <Band> {
                newBand
            };
            List <Band> result = Band.GetAll();

            Assert.Equal(expected, result);
        }
示例#16
0
        public void Test_Save_AssignsIdToSavedObject()
        {
            Band testBand = new Band("Some Band Name", "Some Band Description");

            testBand.Save();

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

            int result   = savedBand.Id;
            int expected = testBand.Id;

            Assert.Equal(expected, result);
        }
示例#17
0
        public void T3_Save_SavesToDB()
        {
            Band testBand = new Band("Brand New");

            testBand.Save();

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

            Assert.Equal(testList, result);
        }
示例#18
0
        public void DeleteAll_DeleteAllBands_Deleted()
        {
            Band band1 = new Band("Lucas Graham");

            band1.Save();
            Band band2 = new Band("Ray LaMontagne");

            band2.Save();

            Band.DeleteAll();

            Assert.Equal(0, Band.GetAll().Count);
        }
示例#19
0
        public void Test_Save_SavesBandToDatabase()
        {
            Band testBand = new Band("Some Band Name", "Some Band Description");

            testBand.Save();

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

            Assert.Equal(testList, result);
        }
示例#20
0
        public void Save_SaveToDatabase_Save()
        {
            Band testBand = new Band("THE SPACE");

            testBand.Save();

            List <Band> result   = Band.GetAll();
            List <Band> expected = new List <Band> {
                testBand
            };

            Assert.Equal(expected, result);
        }
示例#21
0
        public void Test_Save_AssignsIdToBandObject()
        {
            //Arrange
            Band testBand = new Band("The Rough Nighters");

            testBand.Save();
            //Act
            Band savedBand = Band.GetAll()[0];
            int  result    = savedBand.GetId();
            int  testId    = testBand.GetId();

            //Assert
            Assert.Equal(testId, result);
        }
示例#22
0
        public void GetAll_true()
        {
            //Arrange
            Band bandOne = new Band("Black Keys");

            bandOne.Save();
            Band bandTwo = new Band("Modest Mouse");

            bandTwo.Save();
            // Act
            int result = Band.GetAll().Count;

            //Assert
            Assert.Equal(2, result);
        }
示例#23
0
        public void Test_Save_AssignsIdToObject()
        {
            //Arrange
            Band testBand = new Band("Pentatonix", "Pop", "Problem");

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

            int result = savedBand.GetId();
            int testId = testBand.GetId();

            //Assert
            Assert.Equal(testId, result);
        }
示例#24
0
        public void GetAll_RetrievesAllBandsFromDatabase()
        {
            //Arrange
            Band bandOne = new Band("Wilco");

            bandOne.Save();
            Band bandTwo = new Band("John Prine");

            bandTwo.Save();
            // Act
            int result = Band.GetAll().Count;

            //Assert
            Assert.Equal(2, result);
        }
示例#25
0
        public void Test_Save_SavesToDatabase()
        {
            //Arrange
            Band testBand = new Band("John Mayer");

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

            //Assert
            Assert.Equal(testList, result);
        }
示例#26
0
        public void Test_Save_SavesToDatabase()
        {
            //Arrange
            Band testBand = new Band("Pentatonix", "Pop", "Problem");

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

            //Assert
            Assert.Equal(testList, result);
        }
示例#27
0
        public void Test_Save_AssignsIdToObject()
        {
            //Arrange
            Band testBand = new Band("Brittany Spears");

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

            int result = savedBand.GetId();
            int testId = testBand.GetId();

            //Assert
            Assert.Equal(testId, result);
        }
示例#28
0
        public void Test_Save_SavesBandToDatabase()
        {
            //Arrange
            Band testBand = new Band("The LoudMouths");

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

            //Assert
            Assert.Equal(testList, resultList);
        }
示例#29
0
        public void Test_SaveAssignsIdToObject()
        {
            //Arrange
            Band firstBand = new Band("Cameo");

            firstBand.Save();

            //Act
            Band savedBand = Band.GetAll()[0];

            int result = savedBand.GetId();
            int testId = firstBand.GetId();

            //Assert
            Assert.Equal(testId, result);
        }
示例#30
0
        public void Test_Update_UpdatesBandInDatabase()
        {
            Band testBand = new Band("Some Band Name", "Some Band Description");

            testBand.Save();

            string newName        = "nano.RIPE";
            string newDescription = "A Japanese pop rock band with two core members.";

            testBand.Update(newName, newDescription);

            Band result   = Band.GetAll()[0];
            Band expected = new Band(newName, newDescription, testBand.Id);

            Assert.Equal(expected, result);
        }