public void Test_AddCopy_AddAnCopyToAPatron() { Patron testPatron = new Patron ("Jane", "Doe", "555-555-5555"); testPatron.Save(); Copy newCopy = new Copy ("New", 1, new DateTime(2016, 7, 25), new DateTime(2016, 8, 25)); newCopy.Save(); testPatron.AddCopy(newCopy); List<Copy> testCopy = new List<Copy> {newCopy}; List<Copy> allCopies = testPatron.GetCopies(); Assert.Equal(testCopy, allCopies); }
public void AddCopy_AddsCopyToPatron_True() { Patron testPatron = new Patron("Penny Flowers"); testPatron.Save(); Copy newCopy = new Copy(1, 5, DateTime.Today); newCopy.Save(); testPatron.AddCopy(newCopy); List <Copy> expected = new List <Copy> { newCopy }; List <Copy> result = testPatron.GetCopies(); Assert.Equal(expected, result); }
public void T9_GetCopys_ReturnsAllPatronCopys() { Patron testPatron = new Patron("Barb"); testPatron.Save(); Copy testCopy1 = new Copy(5); testCopy1.Save(); Copy testCopy2 = new Copy(6); testCopy2.Save(); testPatron.AddCopy(testCopy1); List <Copy> result = testPatron.GetCopies(); List <Copy> testList = new List <Copy> { testCopy1 }; Assert.Equal(testList, result); }
public void T8_AddCopy_AddsCopyToPatron() { Book newBook = new Book("Freedom"); newBook.Save(); Copy testCopy = new Copy(newBook.GetId()); testCopy.Save(); Patron testPatron = new Patron("Barb"); testPatron.Save(); testPatron.AddCopy(testCopy); List <Copy> result = testPatron.GetCopies(); List <Copy> testList = new List <Copy> { testCopy }; Assert.Equal(testList, result); }
public void T9_GetCopys_ReturnsAllPatronCopys() { Patron testPatron = new Patron("Barb"); testPatron.Save(); Copy testCopy1 = new Copy(5); testCopy1.Save(); Copy testCopy2 = new Copy(6); testCopy2.Save(); testPatron.AddCopy(testCopy1); List<Copy> result = testPatron.GetCopies(); List<Copy> testList= new List<Copy>{testCopy1}; Assert.Equal(testList,result); }
public void T8_AddCopy_AddsCopyToPatron() { Book newBook = new Book("Freedom"); newBook.Save(); Copy testCopy = new Copy(newBook.GetId()); testCopy.Save(); Patron testPatron = new Patron("Barb"); testPatron.Save(); testPatron.AddCopy(testCopy); List<Copy> result = testPatron.GetCopies(); List<Copy> testList = new List<Copy> {testCopy}; Assert.Equal(testList, result); }