public async Task CreateEffectAsync_AlreadyExists_ReturnNameAlreadyExists() { var charProvider = new MockCharacterProvider(); var effectProvider = new MockEffectProvider(); var statProvider = new MockStatisticProvider(); var controller = new EffectController(charProvider, effectProvider, statProvider, new GeneralOptions()); await controller.CreateEffectAsync(1, "AlreadyExists"); var result = await controller.CreateEffectAsync(1, "AlreadyExists"); Assert.Equal(EffectResult.NameAlreadyExists(), result); }
public async Task CreateEffectAsync_ValidInput_ReturnSuccess() { var charProvider = new MockCharacterProvider(); var effectProvider = new MockEffectProvider(); var statProvider = new MockStatisticProvider(); var controller = new EffectController(charProvider, effectProvider, statProvider, new GeneralOptions()); var result = await controller.CreateEffectAsync(1, "ValidInput"); Assert.Equal(EffectResult.EffectCreatedSuccessfully(), result); }
public async Task CreateEffectAsync([Remainder] string effectName) { var result = await _controller.CreateEffectAsync(Context.User.Id, effectName); await ReplyAsync(result.Message); }