Exemple #1
0
        public void HeShouldContinueMovingInPrevDirectionX2IceVert()
        {
            // Arrange
            var testEmptyRules = new TestEmptyRules();
            var field          = new Field(testEmptyRules);

            var startCell = field.Cells(3, 3);
            var iceCell1  = new IceCell(3, 4);
            var iceCell2  = new IceCell(3, 5);
            var endCell   = field.Cells(3, 6);

            field.Draw(iceCell1);
            field.Draw(iceCell2);
            field.SetPirateOnCell(black, startCell);

            // Act
            field.SelectPirate(startCell);
            field.MovePirateTo(black, iceCell1);

            // Assert
            field.Cells(startCell.Position).Pirates.ShouldBeEmpty();
            field.Cells(iceCell1.Position).Pirates.ShouldBeEmpty();
            field.Cells(iceCell2.Position).Pirates.ShouldBeEmpty();
            field.Cells(endCell.Position).Pirates.ShouldContain().Exact(black);
        }
        public void WhenDrawCellItShouldBeLinkedToField()
        {
            // Arrange
            var iceCell = new IceCell(4, 3);

            iceCell.Field.ShouldBeNull();

            // Act
            field.Draw(iceCell);

            // Assert
            iceCell.Field.ShouldBeEqual(field);
        }
 public void TestInit()
 {
     iceCell = new IceCell(1, 1);
 }