Skip to content

Instantly share code, notes, and snippets.

@efleming969
Created June 13, 2018 17:34
Show Gist options
  • Save efleming969/03bd5e753d2519f9f95d982a93068dbe to your computer and use it in GitHub Desktop.
Save efleming969/03bd5e753d2519f9f95d982a93068dbe to your computer and use it in GitHub Desktop.
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