public async Task DeleteAchievement_ShouldReturnVoid_WhenAchievementExists() { // Arange var Id = Guid.NewGuid(); var CancellationToken = new CancellationToken(); AchievementRepoMock .Setup(x => x.Delete(It.IsAny <Guid>(), CancellationToken)) .Returns(() => throw new ArgumentNullException()).Verifiable(); UnitOfWorkMock.Setup(m => m.AchievementRepository).Returns(AchievementRepoMock.Object); AchievementService _AchievementService = new AchievementService(UnitOfWorkMock.Object, MapperMock.Object); // Act // Assert AchievementRepoMock.Verify(); Assert.ThrowsException <ArgumentNullException>(async() => await _AchievementService.DeleteAchievement(It.IsAny <Guid>(), CancellationToken)); }
public void DeleteAchievement_AchievementNotExistis_Exception() { ExceptionAssert.IsThrowing(new ArgumentException("Achievement with Id '0' does not exists."), () => { m_target.DeleteAchievement(0); }); }
public void Delete(object key) { m_service.DeleteAchievement(key); }