示例#1
0
        public async Task DeleteStatistic_ValidInput_ReturnSuccess()
        {
            // Arrange
            var charProvider = new MockCharacterProvider();
            var statProvider = new MockStatisticProvider();
            var controller   = new StatisticController(charProvider, statProvider, new GenericProgressionStrategy(statProvider, new StatisticOptions()));

            // Act
            var result = await controller.DeleteStatisticAsync("strength");

            // Assert
            Assert.Equal(result, StatisticResult.StatisticDeletedSuccessfully());
        }
示例#2
0
        public async Task DeleteStatistic_InvalidStatName_ReturnNotFound()
        {
            // Arrange
            var charProvider = new MockCharacterProvider();
            var statProvider = new MockStatisticProvider();
            var controller   = new StatisticController(charProvider, statProvider, new GenericProgressionStrategy(statProvider, new StatisticOptions()));

            // Act
            var result = await controller.DeleteStatisticAsync("bacon");

            // Assert
            Assert.Equal(result, StatisticResult.StatisticNotFound());
        }
示例#3
0
        public async Task DeleteStatisticAsync([Remainder] string statName)
        {
            var result = await _statController.DeleteStatisticAsync(statName);

            await ReplyAsync(result.Message);
        }