Created
June 13, 2018 17:34
-
-
Save efleming969/03bd5e753d2519f9f95d982a93068dbe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ACME.Api.Controllers | |
{ | |
[Route("api/games")] | |
public class BowlingServiceController : Controller | |
{ | |
[HttpGet("{code}")] | |
public IActionResult GetByCode(string code) | |
{ | |
var fakeRemoteBowlingService = new FakeRemoteBowlingService(); | |
var bowlingService = new BowlingService(fakeRemoteBowlingService); | |
return Ok(bowlingService.GetPlayerData(code)); | |
} | |
} | |
public class FakeRemoteBowlingService : IRemoteBowlingService | |
{ | |
public FakeRemoteBowlingService() | |
{ | |
} | |
public List<RemotePlayerData> Fetch(string code) | |
{ | |
var player1 = new RemotePlayerData() { Name = "joe", Rolls = "11111111111111111111" }; | |
var players = new List<RemotePlayerData>(); | |
players.Add(player1); | |
return players; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment