public void GivenInvalidLocationReturnInvalidMessage()
        {
            var mockLocationConverter = new Mock <ILocationConverter>();

            mockLocationConverter.Setup(x => x.TryGetPoint(It.IsAny <string>(), It.IsAny <Size>())).Returns((false, default(Point)));

            var service = new ShotService(mockLocationConverter.Object);

            var response = service.Shoot("", new GameBoard());

            response.Should().BeEquivalentTo(ShotService.InvalidLocation);
        }
示例#2
0
 public ShotController(ShotService shotService, ShotValidationService validationService)
 {
     this.shotService       = shotService;
     this.validationService = validationService;
 }