public async Task DeleteEffect_InvalidEffectName_ReturnNotFound() { // Arrange var charProvider = new MockCharacterProvider(); var statProvider = new MockStatisticProvider(); var effectProvider = new MockEffectProvider(); var controller = new EffectController(charProvider, effectProvider, statProvider, new GeneralOptions()); // Act var result = await controller.DeleteEffectAsync("DoesNotExist"); // Assert Assert.Equal(result, EffectResult.EffectNotFound()); }
public async Task DeleteEffect_ValidInput_ReturnSuccess() { // Arrange var charProvider = new MockCharacterProvider(); var statProvider = new MockStatisticProvider(); var effectProvider = new MockEffectProvider(); var controller = new EffectController(charProvider, effectProvider, statProvider, new GeneralOptions()); // Act await effectProvider.CreateEffectAsync(1, "ValidInput"); var result = await controller.DeleteEffectAsync("ValidInput"); // Assert Assert.Equal(result, EffectResult.EffectDeletedSuccessfully()); }
public async Task DeleteEffectAsync([Remainder] string effectName) { var result = await _controller.DeleteEffectAsync(effectName); await ReplyAsync(result.Message); }