public void LoginValidUserTest() { using (TransactionScope transaction = new TransactionScope()) { UserLoginRequestModel testUser = new UserLoginRequestModel() { Username = "******", AuthCode = "bfff2dd4f1b310eb0dbf593bd83f94dd8d34077e" }; var response = LoginTestUser(httpServer, testUser); Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); Assert.IsNotNull(response.Content); } }
private HttpResponseMessage LoginTestUser(InMemoryHttpServer httpServer, UserLoginRequestModel testModel) { var response = httpServer.Post("api/users/login", testModel); var contentString = response.Content.ReadAsStringAsync().Result; var userModel = JsonConvert.DeserializeObject<UserRegisterResponseModel>(contentString); return response; }