public void Should_GetCorrectShotResult_WithSingleShot(string shotKey, ShotResultType shotResultType, ShipType?shipType = null) { // Arrange var expectedGameField = ShotKeyInterpreter.GetGameField(shotKey, _gameBoard.GridSize); // Act var shotResult = _gameBoard.ShootAt(shotKey); // Assert shotResult.Should().NotBeNull(); shotResult.ShotResultType.Should().Be(shotResultType); shotResult.ShipType.Should().Be(shipType); shotResult.GameField.Should().Be(expectedGameField); }
public static string EnumTypeToString(ShotResultType type) { switch (type) { case ShotResultType.Miss: return(ShootResultJsonTypes.Miss); case ShotResultType.Damage: return(ShootResultJsonTypes.Damage); case ShotResultType.Kill: return(ShootResultJsonTypes.Kill); } throw new ArgumentException($"Тип не определён, тип - {type.ToString()}.", nameof(type)); }
public ShotResult(GameField gameField, ShotResultType shotResultType, ShipType?shipType = null) { GameField = gameField; ShotResultType = shotResultType; ShipType = shipType; }