public async Task TestCreateGameApiKald() { //Arrange var service = Substitute.For <IRestService>(); Game game = new Game() { gameId = 171, players = null }; LoginUser user = new LoginUser() { passWord = "******", userName = "******" }; // act service.CreateGame(game).Returns(Task.FromResult(game)); var target = new RestService(); await target.GetLoginDataAsync(user); var id = await target.CreateGame(game); //Assert Assert.AreEqual(game.gameId, id.gameId); }