コード例 #1
0
        public void ShouldMapShotResult()
        {
            var shotResult  = new ShotResult();
            var boardDouble = CreateBoardDouble();

            A.CallTo(() => boardDouble.Check(A <Coordinates> ._)).Returns(shotResult);
            StubBoardIsConquered(boardDouble);

            _subject.Start();

            A.CallTo(() => _shotResultMapperDouble.Map(shotResult)).MustHaveHappened();
        }
コード例 #2
0
        public void WhenResultIsHit_ShouldReturnMessageWithShipName()
        {
            var ship = new Destroyer();

            _subject.Map(new ShotResult(ship)).Should().Be($"You hit a {ship.Name}!");
        }