public async void CreateTest(WishDto toCreate, WishDto expected) { var result = await _wishService.CreateAsync(toCreate); Assert.True(result.Id > 0); expected.Id = result.Id; result.ShouldBeEquivalentTo(expected); }
public async Task<WishDto> CreateAsync(WishDto dto) { var wish = _mapper.Map<Wish>(dto); wish = await _wishRepository.AddAsync(wish); await _wishRepository.SaveChangesAsync(); await SendAlertAsync(); return _mapper.Map<WishDto>(wish); }
public async void GetTest(int wishId, WishDto expected) { var result = await _wishService.GetAsync(wishId); result.ShouldBeEquivalentTo(expected); }