public async Task ShouldReturnFailedResult_Because_NotEnoughParameters() { var command = new ChooseCommand(); var text = $"{command.Aliases[0]}"; var message = GenerateMessage(DefaultUser.Id, DefaultUser.Id, text); var result = await command.Execute(message, DefaultUser); result.Should().BeOfType <FailedResult>(); result.Message.Should().NotBeNullOrEmpty(); }
public async Task ShouldReturnSuccessfulResult(string parameters) { var command = new ChooseCommand(); var text = $"{command.Aliases[0]} {parameters}"; var message = GenerateMessage(DefaultUser.Id, DefaultUser.Id, text); var result = await command.Execute(message, DefaultUser); result.Should().BeOfType <SuccessfulResult>(); result.Message.Should().NotBeNullOrEmpty(); }
public ChangeDocumentViewModel(IDocumentChangeModel model) { _model = model; _model.FilesCount = 1; _model.FileHasBeenProcessed += FileHasBeenProcessedMethod; StartCommand = new StartCommand(this); ChooseCommand = new ChooseCommand(this); LaunchExcelCommand = new LaunchExcelCommand(); _verifier = new DirectoryVerifier(); }
public GameVM(string roomID) { _room = roomID; gameBl = GameBL.Instance; _guiDispatcher = Dispatcher.CurrentDispatcher; Dice = new int[2]; _checkerSelection = -1; RollDiceCommand = new CommandExecuter(RollDice, () => { return(TurnStatus == TurnStatus.RollDice && CurrentTurn); }); ChooseCheckerCommand = new ChooseCommand((place) => ChooseChecker(place)); gameBl.OnStartGame += OnStartGame; gameBl.OnDenyInitation += OnDenyInvitation; gameBl.OnGetPlayerColor += OnGetColor; gameBl.OnCurrentTurn += OnCurrentTurn; gameBl.OnGetPlayerName += OnGetPlayerName; gameBl.OnTurnStatusChange += OnChangeStatus; gameBl.OnBoardUpdate += UpdateBoard; gameBl.OnDiceResult += OnDiceResult; gameBl.OnGameOver += GameOver; gameBl.OnGameClosed += OnGameClosed; }
public static bool Validate(this ChooseCommand command, GameState state) { return(state.Choices.Count >= command.Index); }
public ChooseCommandTest() { action = new ChooseCommand(); controllerMock = new Mock <IGameController>(); playerMock = new Mock <IPlayer>(); }