public Field(int width, int height, FieldHelper helper = null) { this.Width = width; this.Height = height; this._field = new Color?[width, height]; this.Helper = helper ?? new FieldHelper(); }
public void Test_IsPositionOutOfField_PositionIsOutOfField_ReturnsTrue() { var field = new Color?[,]{ {null} }; var subject = new FieldHelper(); var position = new Vector2(-1, -1); Assert.That(subject.IsPositionOutOfField(position, field), Is.True); }
public void Test_IsPositionBlocked_PositionIsFree_ReturnsFalse() { var field = new Color?[,]{ {null} }; var subject = new FieldHelper(); var vector = new Vector2(0, 0); Assert.That(subject.IsPositionBlocked(vector, field), Is.False); }
public void Test_IsPositionOutOfField_PositionIsNotOutOfField_ReturnsFalse() { var field = new Color?[,]{ {null} }; var subject = new FieldHelper(); var position = new Vector2(0, 0); Assert.That(subject.IsPositionOutOfField(position, field), Is.False); }
public void Test_IsPositionBlocked_PositionIsBlocked_ReturnsTrue() { var field = new Color?[,]{ {Color.Red} }; var subject = new FieldHelper(); var vector = new Vector2(0, 0); Assert.That(subject.IsPositionBlocked(vector, field), Is.True); }