public void GetParameters_ShouldReturn_NotNull() { // Arrange List <ParametersDtoModel> parametersDtos = new List <ParametersDtoModel>(); fakeParametersRepository.Setup(a => a.GetAll()).Returns(new List <ParametersModel>()); parametersService = new ParametersService(fakeParametersRepository.Object, new Mock <ICommonRepository>().Object); try { // Act parametersDtos = (List <ParametersDtoModel>)parametersService.GetParameters(); } catch (Exception ex) { errorMessage = ex.Message + " | " + ex.StackTrace; } // Assert Assert.IsNotNull(parametersDtos, errorMessage); }