Пример #1
0
        public void ChangeShelfNumberNoSuchShelf()
        {
            var shelfManagerMock = SetupMock((Shelf)null);

            var storageAPI = new StorageAPI(null, shelfManagerMock.Object);
            var result     = storageAPI.ChangeShelfNumber(1, 2);

            Assert.AreEqual(ChangeShelfNumberStatusCodes.NoSuchShelf, result);
            shelfManagerMock.Verify(m =>
                                    m.ChangeShelfNumber(1, 2), Times.Never());
        }
Пример #2
0
        public void ChangeShelfNumberToSameShelfNumber()
        {
            var aisleManagerMock = SetupMock(new Aisle {
                AisleID = 1
            });
            var shelfManagerMock = new Mock <IShelfManager>();

            shelfManagerMock.Setup(m =>
                                   m.GetShelfByShelfId(It.IsAny <int>()))
            .Returns(new Shelf
            {
                ShelfID     = 1,
                Aisle       = new Aisle(),
                ShelfNumber = 1
            });

            var storageAPI = new StorageAPI(aisleManagerMock.Object, shelfManagerMock.Object);
            var result     = storageAPI.ChangeShelfNumber(1, 1);

            Assert.AreEqual(ChangeShelfNumberStatusCodes.CanNotChangeToSameNumber, result);
            shelfManagerMock.Verify(m =>
                                    m.ChangeShelfNumber(1, 1), Times.Never());
        }