public async Task ArchiveWallet_WalletDoesNotExist_ShouldReturnFailure() { _walletRepoMock.Setup(x => x.GetWithoutDependencies(It.IsAny <int>(), It.IsAny <string>())).Returns(Task.FromResult(default(UserWallet))); var sut = new WalletService(Mapper, _walletRepoMock.Object, _emailServiceMock.Object); var result = await sut.ArchiveWallet(Guid.NewGuid().ToString(), Guid.NewGuid().ToString()); result.Succedeed.Should().BeFalse(); }
public async Task ArchiveWallet_WalletExistsAndUserIsNotAdmin_ShouldReturnSuccess() { _walletRepoMock.Setup(x => x.GetWithoutDependencies(It.IsAny <int>(), It.IsAny <string>())) .ReturnsAsync(new UserWallet { Role = WalletRole.Normal, Wallet = new Wallet() }); _walletRepoMock.Setup(x => x.Update(It.IsAny <UserWallet>())).Returns(1); var sut = new WalletService(Mapper, _walletRepoMock.Object, _emailServiceMock.Object); var result = await sut.ArchiveWallet(Guid.NewGuid().ToString(), Guid.NewGuid().ToString()); result.Succedeed.Should().BeTrue(); }