Exemplo n.º 1
0
    public void ShouldBeGameOverWhenCantAddGroup()
    {
        IGridState readyFoNextGroupState = new ReadyForNextGroupState(setting, gridMock, groupFactoryMock, Substitute.For <OnDeleteEndEventHandler>());

        gridMock.AddGroup(Arg.Any <IGroup>()).Returns(false);

        readyFoNextGroupState.OnUpdate();
        groupFactoryMock.Received().Create(setting);
        gridMock.Received().GameOver();
    }
Exemplo n.º 2
0
    public void ReadyForNextGroupShouldCreateGroupToAdd()
    {
        IGridState readyFoNextGroupState = new ReadyForNextGroupState(setting, gridMock, groupFactoryMock, Substitute.For <OnDeleteEndEventHandler>());

        gridMock.AddGroup(Arg.Any <IGroup>()).Returns(true);

        readyFoNextGroupState.OnUpdate();
        groupFactoryMock.Received().Create(setting);
        gridMock.Received().SetState(GridStates.OnControlGroup);
    }
Exemplo n.º 3
0
    public void ShouldBeGameOverWhenCantAddGroup()
    {
        IGridState readyFoNextGroupState = new ReadyForNextGroupState(setting, gridMock, groupFactoryMock, Substitute.For<OnDeleteEndEventHandler>());
        gridMock.AddGroup(Arg.Any<IGroup>()).Returns(false);

        readyFoNextGroupState.OnUpdate();
        groupFactoryMock.Received().Create(setting);
        gridMock.Received().GameOver();
    }
Exemplo n.º 4
0
    public void ReadyForNextGroupShouldCreateGroupToAdd()
    {
        IGridState readyFoNextGroupState = new ReadyForNextGroupState(setting, gridMock, groupFactoryMock, Substitute.For<OnDeleteEndEventHandler>());
        gridMock.AddGroup(Arg.Any<IGroup>()).Returns(true);

        readyFoNextGroupState.OnUpdate();
        groupFactoryMock.Received().Create(setting);
        gridMock.Received().SetState(GridStates.OnControlGroup);
    }