public async void GetOneParametrizationCriteriaWhenNoExistsTest() { //Arrange var mockParametrizationCriteriaRepository = new Mock <IParametrizationCriteriaRepository>(); mockParametrizationCriteriaRepository.Setup(e => e.Get(It.IsAny <int>())).Returns <Domain.ParametrizationCriteria.ParametrizationCriteria>(null); var useCase = new GetOneParametrizationCriteriaUseCase(mockParametrizationCriteriaRepository.Object); //Act //Assert Assert.Throws <EntityNotFoundException>(() => useCase.Execute(1)); }
public async void GetOneParametrizationCriteriaWhenExistsTest() { //Arrange var param = new Domain.ParametrizationCriteria.ParametrizationCriteria("prueba", "int", 2); var mockParametrizationCriteriaRepository = new Mock <IParametrizationCriteriaRepository>(); mockParametrizationCriteriaRepository.Setup(e => e.Get(It.IsAny <int>())).Returns(param); var useCase = new GetOneParametrizationCriteriaUseCase(mockParametrizationCriteriaRepository.Object); //Act var res = useCase.Execute(1); //Assert Assert.IsType <ParametrizationCriteriaOutput>(res); }