public void Test_Find_FindsBandInDatabase() { Band testBand = new Band("Frets on Fire", 0); testBand.Save(); Band foundBand = Band.Find(testBand.GetId()); Assert.Equal(testBand, foundBand); }
public void Find_ReturnsFoundBand_name() { Band newBand = new Band("Radiohead"); newBand.Save(); Band foundBand = Band.Find(newBand.GetId()); Assert.Equal(newBand, foundBand); }
public void Find_VenueId_ReturnVenueFromDatabase() { Band testBand = new Band("THE SPACE"); testBand.Save(); Band foundBand = Band.Find(testBand.GetId()); Assert.Equal(testBand, foundBand); }
public void Test5_FindBandInDatabase() { Band testBand = new Band("Sting"); testBand.Save(); Band foundBand = Band.Find(testBand.GetId()); Assert.Equal(testBand, foundBand); }
public void Delete_RemoveBandFromDatabase_Deleted() { Band newBand = new Band("Adele"); newBand.Save(); Band.Delete(newBand.GetId()); Assert.Equal(0, Band.GetAll().Count); }
public void T5_Find_FindsBandInDB() { Band testBand = new Band("Brand New"); testBand.Save(); Band foundBand = Band.Find(testBand.GetId()); Assert.Equal(testBand, foundBand); }
public void Test_Find_FindsBandInDatabase() { //Arrange Band testBand = new Band("The NoiseMakers"); testBand.Save(); //Act Band foundBand = Band.Find(testBand.GetId()); //Assert Assert.Equal(testBand, foundBand); }
public void Band_Update_UpdatesInDb() { Band testBand = new Band("Name"); testBand.Save(); testBand.Update("new Name"); Band newBand = new Band("new Name", testBand.GetId()); Assert.Equal(testBand, newBand); }
public void Find_ReturnsBandBasedOnId_Band() { Band newBand = new Band("Journey"); newBand.Save(); Band expectedResult = newBand; Band actualResult = Band.Find(newBand.GetId()); Assert.Equal(expectedResult, actualResult); }
public void Find_FindsBandInDB_True() { //Arrange Band newBand = new Band("Misery Jackyls", "3308698686"); newBand.Save(); Band foundBand = Band.Find(newBand.GetId()); //Assert Assert.Equal(foundBand, newBand); }
public void Test_Find_FindsBandInDatabase() { //Arrange Band testBand = new Band("Reo", "rock"); testBand.Save(); //Act Band foundBand = Band.Find(testBand.GetId()); //Assert Assert.Equal(testBand, foundBand); }
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); }
public void Test_Find_FindsBandsInDatabase() { //Arrange Band testBand = new Band("The Rolling Stones"); testBand.Save(); //Act Band foundBand = Band.Find(testBand.GetId()); //Assert Assert.Equal(testBand, foundBand); }
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); }
public void Find_FindsBandById_true() { //Arrange Band newBand = new Band("Wilson Phillips"); newBand.Save(); //Act Band foundBand = Band.Find(newBand.GetId()); //Assert Assert.Equal(newBand, foundBand); }
public void Find_BandById_FoundBand() { Band newBand1 = new Band("CCR"); newBand1.Save(); Band newBand2 = new Band("Lily Allen"); newBand2.Save(); Band foundBand = Band.Find(newBand2.GetId()); Assert.Equal(foundBand, newBand2); }
public void Edit_ChangesName_true() { //Arrange Band newBand = new Band("Three Dog Night"); newBand.Save(); //Act newBand.Edit("Dog's Eye View"); Band foundBand = Band.Find(newBand.GetId()); //Assert Assert.Equal("Dog's Eye View", foundBand.GetName()); }
public void Test_Find_FindBandInDatabase() { //Arrange Band testBand = new Band("Pentatonix", "Pop", "Problem"); testBand.Save(); //Act Band foundBand = Band.Find(testBand.GetId()); //Assert Assert.Equal(testBand, foundBand); }
public void Test_Find_FindsBandInDatabase() { //Arrange Band firstBand = new Band("Cameo"); firstBand.Save(); //Act Band result = Band.Find(firstBand.GetId()); //Assert Assert.Equal(firstBand, result); }
public void Find_FindsBandInDatabase_true() { //Arrange Band testBand = new Band("Black Keys"); testBand.Save(); //Act Band foundBand = Band.Find(testBand.GetId()); //Assert Assert.Equal(testBand, foundBand); }
public void Find_FindsBandInDatabase_Band() { //Arrange Band testBand = new Band("John Mayer Trio"); testBand.Save(); //Act Band result = Band.Find(testBand.GetId()); //Assert Assert.Equal(testBand, result); }
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); }
public override bool Equals(System.Object otherBand) { if (!(otherBand is Band)) { return(false); } else { Band newBand = (Band)otherBand; bool idEquality = this.GetId() == newBand.GetId(); bool nameEquality = this.GetName() == newBand.GetName(); return(idEquality && nameEquality); } }
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); }
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); }
public void T6_GetBandName_GetsPerformanceBandName() { Band testBand = new Band("Brand New"); testBand.Save(); DateTime performanceDate = new DateTime(2016, 08, 04); Performance testPerformance = new Performance(1, testBand.GetId(), performanceDate); testPerformance.Save(); string result = testPerformance.GetBandName(); Assert.Equal("Brand New", result); }
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); }
public void Save_AssignsIdToBandObject_true() { //Arrange Band testBand = new Band("Florence and the Machine"); testBand.Save(); //Act Band savedBand = Band.GetAll()[0]; int result = savedBand.GetId(); int testId = testBand.GetId(); //Assert Assert.Equal(testId, result); }
public void Test_Save_AssignsIdToObject() { //Arrange Band testBand = new Band("Angry Fish"); //Act testBand.Save(); Band savedBand = Band.GetBands()[0]; int result = savedBand.GetId(); int testId = testBand.GetId(); //Assert Assert.Equal(testId, result); }
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); }
public void Test_Find_FindsBandInDatabase() { //Arrange Band testBand1 = new Band("band1"); testBand1.Save(); Band testBand2 = new Band("band2"); testBand2.Save(); //Act Band result = Band.Find(testBand2.GetId()); //Assert Assert.Equal(testBand2, result); }
public void AddBand(Band newBand) { SqlConnection conn = DB.Connection(); conn.Open(); SqlCommand cmd = new SqlCommand("INSERT INTO bands_venues (band_id, venue_id) OUTPUT INSERTED.id VALUES (@BandId, @VenueID);", conn); cmd.Parameters.Add(new SqlParameter("@BandId", newBand.GetId())); cmd.Parameters.Add(new SqlParameter("@VenueId", this.GetId())); cmd.ExecuteNonQuery(); if (conn != null) { conn.Close(); } }
// methods to interact with the Band class // a method to add a new link between a band and venue instance public void AddBand(Band newBand) { SqlConnection conn = DB.Connection(); conn.Open(); SqlCommand cmd = new SqlCommand("INSERT INTO events (venue_id, band_id) VALUES (@VenueId, @BandId);", conn); SqlParameter venueIdParameter = new SqlParameter(); venueIdParameter.ParameterName = "@VenueId"; venueIdParameter.Value = this.GetId(); cmd.Parameters.Add(venueIdParameter); SqlParameter bandIdParameter = new SqlParameter(); bandIdParameter.ParameterName = "@BandId"; bandIdParameter.Value = newBand.GetId(); cmd.Parameters.Add(bandIdParameter); cmd.ExecuteNonQuery(); if (conn != null) { conn.Close(); } }
public void Test_Find_FindsBandInDatabase() { DateTime testTime = new DateTime(2016, 1, 1); Band testBand = new Band("A",testTime); testBand.Save(); Band foundBand = Band.Find(testBand.GetId()); Assert.Equal(testBand, foundBand); }
public void Test_Save_AssignsIdToObject() { DateTime testTime = new DateTime(2016, 1, 1); Band testBand=new Band("A",testTime); testBand.Save(); Band savedBand = Band.GetAll()[0]; int result=savedBand.GetId(); int testId=testBand.GetId(); Assert.Equal(testId,result); }