public void Convert_Entity_To_DTO_Should_Convert_Properly() { var input = _advertisementEntityFaker.Generate(1).FirstOrDefault(); var result = _sut.Convert(input); result.Id.ShouldBe(input.Id); result.Title.ShouldBe(input.Title); result.Description.ShouldBe(input.Description); result.Price.ShouldBe(input.Price); result.PublicationDate.ShouldBe(input.PublicationDate); }
public async Task AddAsync(AdvertisementDTO model) { model.PublicationDate = DateTime.Now; var entity = _converter.Convert(model); await _repository.AddAsync(entity); }