public void TestIfUserCanGetHighScores() { IApplicationData data = Mock.Create <IApplicationData>(); Score[] scores = { new Score(), new Score(), new Score() }; Mock.Arrange(() => data.Score.All()) .Returns(() => scores.AsQueryable()); var server = new InMemoryHttpServer <Score>(this.inMemoryServerUrl, data); var response = server.CreateGetRequest("/api/scores"); Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); Assert.IsNotNull(response.Content); }
public void TestIfUserCanGetViewUnstartedGames() { IApplicationData data = Mock.Create <IApplicationData>(); Game[] games = { new Game(), new Game(), new Game() }; Mock.Arrange(() => data.Games.All()) .Returns(() => games.AsQueryable()); var server = new InMemoryHttpServer <Game>(this.inMemoryServerUrl, data); var response = server.CreateGetRequest("/api/games"); Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); Assert.IsNotNull(response.Content); }