Exemple #1
0
        public void DeletePoint_200()
        {
            newUser = _tu.CreateUserObject();
            Session newSession = _tu.CreateSessionObject(newUser);

            _tu.CreateSessionInDb(newSession);

            var point = _tu.CreatePointObject(179, 81);

            point = _tu.CreatePointInDb(point);

            var endpoint = API_ROUTE_LOCAL + "/api/point/" + point.Id;

            controller.Request = new HttpRequestMessage
            {
                RequestUri = new Uri(endpoint)
            };

            var request = new HttpRequestMessage();

            request.Headers.Add("token", newSession.Token);

            controller.Request = request;

            OkResult response = (OkResult)controller.Delete(point.Id.ToString());
            NegotiatedContentResult <string> result404 = (NegotiatedContentResult <string>)controller.Get(point.Id.ToString());

            Assert.IsInstanceOfType(response, typeof(OkResult));
            Assert.AreEqual(result404.StatusCode, HttpStatusCode.NotFound);
        }