Пример #1
0
        public async Task AddEffectAsync_MultipleEffects_ReturnSuccess()
        {
            // Arrange
            var charProvider   = new MockCharacterProvider();
            var effectProvider = new MockEffectProvider();
            var statProvider   = new MockStatisticProvider();
            var controller     = new EffectController(charProvider, effectProvider, statProvider, new GeneralOptions());

            var effect = await effectProvider.CreateEffectAsync(1, "ValidInput");

            var effect2 = await effectProvider.CreateEffectAsync(1, "ValidInput2");

            // Act
            await controller.AddEffectAsync(1, "ValidInput");

            await controller.AddEffectAsync(1, "ValidInput2");

            // Assert
            var character = await charProvider.GetActiveCharacterAsync(1);

            Assert.True(character.Effects.Contains(effect) && character.Effects.Contains(effect2));
        }
Пример #2
0
        public async Task AddEffectAsync([Remainder] string effectName)
        {
            var result = await _controller.AddEffectAsync(Context.User.Id, effectName);

            await ReplyAsync(result.Message);
        }