public void CheckoutCommand_Should_Incdicate_Success_Message_On_Success() { Biblotica biblotica = new Biblotica (new List<Book>(){new Book("A","a",1990,"ISBN1990")}); CheckoutCommand command = new CheckoutCommand (biblotica,"ISBN1990"); CommandResult result = command.Execute (); Book checkedoutBook = result.Data as Book; Assert.AreEqual ("ISBN1990", checkedoutBook.Id); }
public void CheckoutCommand_Should_Write_Success_Message_To_View() { Biblotica biblotica = new Biblotica (new List<Book>(){new Book("A","a",1990,"ISBN1990")}); CheckoutCommand command = new CheckoutCommand (biblotica,"ISBN1990"); command.Execute (); MockView view = new MockView ("Thank you! Enjoy the book"); command.WriteResultDataToView (view); view.Verify(); }
public void CheckoutCommand_Should_Incdicate_Failure_Message_To_View() { Biblotica biblotica = new Biblotica (new List<Book>(){new Book("A","a",1990,"ISBN1990")}); CheckoutCommand command = new CheckoutCommand (biblotica,"ISBN19900"); command.Execute (); MockView view = new MockView ("That book is not available."); command.WriteResultDataToView (view); view.Verify(); }