public void WhenDeletingModelWithInvalidId_ExceptionIsThrown(string selection) { CarLogic logic = new CarLogic(); logic.SetRepositoryInterface(this.mockedRepository.Object); Assert.Throws(typeof(InvalidParameterException), () => logic.DeleteModel(selection)); }
/// <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); }