public async Task GetShotInvalidBody() { var mock = RequestResponseMocker.Create("dummy {"); var api = new Players.RandomPlayerApi(config.JsonOptions, config.Serializer); await api.GetShots(mock.RequestMock.Object); Assert.Equal(HttpStatusCode.BadRequest, mock.ResponseMock.Object.StatusCode); }
public async Task GetShots() { var shotRequests = new[] { new ShotRequest(null, new BoardContent().ToShortString()) }; var mock = RequestResponseMocker.Create(JsonSerializer.Serialize(shotRequests, config.JsonOptions)); var api = new Players.RandomPlayerApi(config.JsonOptions, config.Serializer); await api.GetShots(mock.RequestMock.Object); JsonSerializer.Deserialize <BoardIndex[]>(mock.ResponseBodyAsString, config.JsonOptions); Assert.Equal(HttpStatusCode.OK, mock.ResponseMock.Object.StatusCode); }