Пример #1
0
        public async Task Add_Should_Call_Add_For_Mapped_DTO()
        {
            var entity = new Advertisement();
            var dto    = new AdvertisementDTO();

            _converterMock.Setup(x => x.Convert(dto)).Returns(entity);

            await _sut.AddAsync(dto);

            _repositoryMock.Verify(x => x.AddAsync(entity), Times.Once);
        }
Пример #2
0
        public async Task <IActionResult> Post([FromBody] AdvertisementDTO dto)
        {
            await _service.AddAsync(dto);

            return(Ok());
        }