Beispiel #1
0
        public async Task <IActionResult> Create([FromBody] DiseaseRequest request)
        {
            try
            {
                await diseaseService.CreateAsync(request);

                return(Ok());
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
        public async Task CreateAsync_DiseaseValidationSucceed_CreatesStreet()
        {
            // Arrange
            var disease  = new DiseaseUpdateModel();
            var expected = new Disease();

            var diseaseDAL = new Mock <IDiseaseDAL>();

            diseaseDAL.Setup(x => x.InsertAsync(disease)).ReturnsAsync(expected);

            var diseaseService = new DiseaseService(diseaseDAL.Object);

            // Act
            var result = await diseaseService.CreateAsync(disease);

            // Assert
            result.Should().Be(expected);
        }