Ejemplo n.º 1
0
        public void ExecuteCommand_UnregisteredCharacter_Fail(string characterName)
        {
            var readyCommand = new RDVFSharp.Commands.Ready();

            readyCommand.Plugin = TestData.GetPlugin();
            Assert.Throws <FighterNotRegistered>(() => readyCommand.ExecuteCommand(characterName, new string[0], TestData.DebugChannel));
        }
Ejemplo n.º 2
0
        public void ExecuteCommand_FightAlreadyGoingOn_Fail(string characterName)
        {
            var readyCommand = new RDVFSharp.Commands.Ready();

            readyCommand.Plugin = TestData.GetPlugin();
            readyCommand.Plugin.CurrentBattlefield.IsActive = true;
            Assert.Throws <FightInProgress>(() => readyCommand.ExecuteCommand(characterName, new string[0], TestData.DebugChannel));
        }
Ejemplo n.º 3
0
        public async void ExecuteCommand_SameCharacterShouldntJoinTwice_Fail()
        {
            var readyCommand = new RDVFSharp.Commands.Ready();

            readyCommand.Plugin = TestData.GetPlugin();
            var fighter = await readyCommand.Plugin.Context.Fighters.FirstOrDefaultAsync();

            readyCommand.ExecuteCommand(fighter.Name, new string[0], TestData.DebugChannel);
            Assert.Throws <FighterAlreadyExists>(() => readyCommand.ExecuteCommand(fighter.Name, new string[0], TestData.DebugChannel));
        }