Esempio n. 1
0
        public void WhenDeletingModelWithInvalidId_ExceptionIsThrown(string selection)
        {
            CarLogic logic = new CarLogic();

            logic.SetRepositoryInterface(this.mockedRepository.Object);

            Assert.Throws(typeof(InvalidParameterException), () => logic.DeleteModel(selection));
        }
Esempio n. 2
0
        /// <summary>
        /// Checks if repository was called once
        /// </summary>
        /// <param name="selection">id of the extra</param>
        public void WhenDeletingExtra_RepositoryIsCalled(string selection)
        {
            CarLogic logic = new CarLogic();

            // this.mockedRepository.Setup(m => m.DeleteModelRepo(It.IsAny<car_models>()));
            logic.SetRepositoryInterface(this.mockedRepository.Object);
            logic.DeleteModel(selection);
            this.mockedRepository.Verify(m => m.DeleteExtraRepo(It.IsAny <extra>()), Times.Once);
        }