public void MixtapeComputerTest_MixtapesAreEmpty_ShouldBeZero() //we're going to check to see what is the total value of the mixtapes when they are empty our expected behavior is that they are going to be zero { //Arrange MixtapeCalculator MC = new MixtapeCalculator(); List <MixtapeBLL> input = new List <MixtapeBLL>(); List <MixtapeStatistics> ExpectedOutput = new List <MixtapeStatistics>(); //Act var Actualoutput = MC.MixtapeComputer(input); //Asssert Assert.AreEqual(ExpectedOutput.Count, Actualoutput.Count);//counting the expected and actual outputs to check and be sure they are equal }
public void MixtapeComputerTest_LengthPerSongAvg_ShouldBe5() // The average length per song by mixtape in this test should be 5 { //Arrange MixtapeCalculator MC = new MixtapeCalculator(); List <MixtapeBLL> input = new List <MixtapeBLL>(); MixtapeBLL one = new MixtapeBLL();//we will again take all the required information we need per mixtape one.Length = 10; one.MixtapeID = 1; one.NumberOfSongs = 2; input.Add(one);//we are now inputing all of this information we defined in the lines above into the mixtape bll with the name of one MixtapeBLL two = new MixtapeBLL(); two.Length = 20; two.MixtapeID = 2; two.NumberOfSongs = 4; input.Add(two); //we are taking all of the above information and inserting it into the new mixtape bll of 2 int ExpectedOutput = 5; //we are declaring the Expected output we declared in the ExpectedBehavior part in our unit testing naming convention so the output should be 5 //Act var Actualoutput = MC.MixtapeComputer(input); //Asssert Assert.AreEqual(ExpectedOutput, Actualoutput[0].AvgLengthPerSongBymixtape);//Is testing wether the values are equal and throw an exception in our test if it is not }
public void MixtapeComputerTest_TotalSongsByArtist_ShouldBe7() //Here we should be getting the total Number of Songs by the artist using similar methods as a few of the above methods { //Arrange MixtapeCalculator MC = new MixtapeCalculator(); List <MixtapeBLL> input = new List <MixtapeBLL>(); MixtapeBLL one = new MixtapeBLL(); one.ArtistName = "HollywoodGrove"; one.Length = 10; one.NumberOfSongs = 4; input.Add(one); MixtapeBLL two = new MixtapeBLL(); two.ArtistName = "HollywoodGrove"; two.MixtapeID = 2; two.NumberOfSongs = 3; input.Add(two); int ExpectedOutput = 7; //Act var Actualoutput = MC.MixtapeComputer(input); //Asssert Assert.AreEqual(ExpectedOutput, Actualoutput[0].TotalSongsByArtist); }