Exemple #1
0
        public void ReadPoint_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;

            OkNegotiatedContentResult <Point> response = (OkNegotiatedContentResult <Point>)controller.Get(point.Id.ToString());

            Assert.AreEqual(point.Name, response.Content.Name);
            Assert.AreEqual(point.Description, response.Content.Description);
            Assert.AreEqual(point.Longitude, response.Content.Longitude);
            Assert.AreEqual(point.Latitude, response.Content.Latitude);
        }