public async Task SetBackgroundAddAsync() { backgroundsOwnedRepositoryMock.Setup(x => x.GetAsync(It.IsAny <long>(), It.IsAny <int>())) .Returns(new ValueTask <BackgroundsOwned>(new BackgroundsOwned())); await backgroundService.SetBackgroundAsync(1L, 1); profileVisualsRepositoryMock.Verify( x => x.AddAsync(It.Is <ProfileVisuals>(x => x.BackgroundId == 1 && x.UserId == 1L))); unitOfWorkMock.Verify(x => x.CommitAsync()); }