Пример #1
0
 public LibraryExplorer(LibraryApiClient apiClient)
 {
     var bookBag = new BookBag();
     _defaultCommands = new List<ICommand>
     {
         new ExploreLibraryCommand(apiClient,bookBag),
         new ViewCheckedOutBooksCommand(bookBag,apiClient),
         new ExitLibraryCommand(),
     };
 }
Пример #2
0
        public void Initial_list_is_empty_bagbooks()
        {
            // Arrange

            // Act
            BookBag <string> myList = new BookBag <string>();

            // Assert
            Assert.Equal(0, myList.Count);
        }
Пример #3
0
        public void Add_to_emptyList_bookbags()
        {
            // Arrange
            BookBag <int> myList = new BookBag <int>();

            // Act
            myList.Add(4);

            // Assert
            Assert.Equal(1, myList.Count);
        }
Пример #4
0
        public LibraryExplorer(LibraryApiClient apiClient)
        {
            var bookBag = new BookBag();

            _defaultCommands = new List <ICommand>
            {
                new ExploreLibraryCommand(apiClient, bookBag),
                new ViewCheckedOutBooksCommand(bookBag, apiClient),
                new ExitLibraryCommand(),
            };
        }
Пример #5
0
        public void Add_to_List_bookbag()
        {
            // Arrange
            BookBag <int> myList = new BookBag <int>();

            myList.Add(4);
            myList.Add(1);
            myList.Add(6);
            // Act
            myList.Add(2);

            // Assert
            Assert.Equal(4, myList.Count);
        }
Пример #6
0
        public void can_add_over_capacity_bookbags()
        {
            int capacity = 4;
            // Arrange
            BookBag <int> myList = new BookBag <int>(capacity);

            // Act
            myList.Add(1);
            myList.Add(2);
            myList.Add(3);
            myList.Add(4);
            myList.Add(5);
            myList.Add(6);


            // Assert
            Assert.Equal(6, myList.Count);
        }
 public ViewCheckedOutBooksCommand(BookBag bookBag, LibraryApiClient libraryApiClient)
 {
     _bookBag = bookBag;
     _libraryApiClient = libraryApiClient;
 }
 public ViewCheckedOutBooksCommand(BookBag bookBag, LibraryApiClient libraryApiClient)
 {
     _bookBag          = bookBag;
     _libraryApiClient = libraryApiClient;
 }
 public ExploreLibraryCommand(LibraryApiClient libraryApiClient,BookBag bookBag)
 {
     _libraryApiClient = libraryApiClient;
     _bookBag = bookBag;
 }
Пример #10
0
 public ViewBookCommand(Book book, BookBag bookBag, LibraryApiClient libraryApiClient)
 {
     _book             = book;
     _bookBag          = bookBag;
     _libraryApiClient = libraryApiClient;
 }
 public ExploreLibraryCommand(LibraryApiClient libraryApiClient, BookBag bookBag)
 {
     _libraryApiClient = libraryApiClient;
     _bookBag          = bookBag;
 }
Пример #12
0
 public CheckOutBookCommand(Book book, BookBag bookBag, LibraryApiClient libraryApiClient)
 {
     _bookBag = bookBag;
     _book = book;
     _libraryApiClient = libraryApiClient;
 }