public void RemoveNonexistingBookShelfAisle()
        {
            var bookShelfAisleManagerMock = new Mock <IBookshelfAisleManager>();
            var shelfManagerMock          = new Mock <IShelfManager>();

            bookShelfAisleManagerMock.Setup(m =>
                                            m.GetBookshelfAisleByBookshelfAisleNumber(It.IsAny <int>()))
            .Returns((BookShelfAisle)null);

            var aisleAndShelfAPI = new AisleAndShelfAPI(bookShelfAisleManagerMock.Object,
                                                        shelfManagerMock.Object, null);
            var successfull = aisleAndShelfAPI.RemoveBookShelfAisle(3);

            Assert.AreEqual(RemoveBookShelfAisleError.NoSuchBookShelfAisle, successfull);
            bookShelfAisleManagerMock.Verify(m =>
                                             m.RemoveBookshelfAisle(It.IsAny <int>()), Times.Never);
        }
        public void RemoveEmptyBookShelfAisle()
        {
            var bookShelfAisleManagerMock = new Mock <IBookshelfAisleManager>();
            var BookShelfAisleManagerMock = new Mock <IBookshelfAisleManager>();
            var shelfManagerMock          = new Mock <IShelfManager>();

            bookShelfAisleManagerMock.Setup(m =>
                                            m.GetBookshelfAisleByBookshelfAisleNumber(It.IsAny <int>()))
            .Returns(new BookShelfAisle
            {
                BookshelfAisleNumber = 3,
                Shelf = new List <Shelf>()
            });

            var asileAndShelfAPI = new AisleAndShelfAPI(
                bookShelfAisleManagerMock.Object, shelfManagerMock.Object, null);
            var successfull = asileAndShelfAPI.RemoveBookShelfAisle(3);

            Assert.AreEqual(RemoveBookShelfAisleError.Ok, successfull);
            bookShelfAisleManagerMock.Verify(m =>
                                             m.RemoveBookshelfAisle(It.IsAny <int>()), Times.Once);
        }
        public void RemoveBookShelfAisleWithOneShelf()
        {
            var bookShelfAisleManagerMock = new Mock <IBookshelfAisleManager>();
            var shelfManagerMock          = new Mock <IShelfManager>();

            bookShelfAisleManagerMock.Setup(m =>
                                            m.GetBookshelfAisleByBookshelfAisleNumber(It.IsAny <int>()))
            .Returns(new BookShelfAisle
            {
                BookshelfAisleNumber = 4,
                Shelf = new List <Shelf>
                {
                    new Shelf()
                }
            });

            var aisleAndShelfAPI = new AisleAndShelfAPI(
                bookShelfAisleManagerMock.Object, shelfManagerMock.Object, null);
            var successfull = aisleAndShelfAPI.RemoveBookShelfAisle(4);

            Assert.AreEqual(RemoveBookShelfAisleError.BookShelfAisleHasShelf, successfull);
            bookShelfAisleManagerMock.Verify(m =>
                                             m.RemoveBookshelfAisle(It.IsAny <int>()), Times.Never);
        }