コード例 #1
0
        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());
        }
コード例 #2
0
        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());
        }
コード例 #3
0
ファイル: EffectModule.cs プロジェクト: MickMelon/FRAGS
        public async Task DeleteEffectAsync([Remainder] string effectName)
        {
            var result = await _controller.DeleteEffectAsync(effectName);

            await ReplyAsync(result.Message);
        }