コード例 #1
0
        public void RemoveNonExistingAisle()
        {
            var aisleManagerMock = SetupMock((Aisle)null);
            var shelfManagerMock = new Mock <IShelfManager>();

            var storageAPI  = new StorageAPI(aisleManagerMock.Object, shelfManagerMock.Object);
            var successfull = storageAPI.RemoveAisle(4);

            Assert.AreEqual(RemoveAisleErrorCodes.NoSuchAisle, successfull);
            aisleManagerMock.Verify(m =>
                                    m.RemoveAisle(It.IsAny <int>()), Times.Never);
        }
コード例 #2
0
        public void RemoveEmptyAisle()
        {
            var aisleManagerMock = SetupMock(new Aisle
            {
                AisleNumber = 4,
                Shelfs      = new List <Shelf>()
            });
            var shelfManagerMock = new Mock <IShelfManager>();

            var storageAPI  = new StorageAPI(aisleManagerMock.Object, shelfManagerMock.Object);
            var successfull = storageAPI.RemoveAisle(4);

            Assert.AreEqual(RemoveAisleErrorCodes.Ok, successfull);
            aisleManagerMock.Verify(m =>
                                    m.RemoveAisle(It.IsAny <int>()), Times.Once);
        }