Example #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();
    }
Example #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);
    }
Example #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();
    }
Example #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);
    }