Exemple #1
0
        public void AsserThatControllerReturnsUnauthorizedWhenTokenIsNull()
        {
            var controller = new AreaController();
            var resut      = controller.GetAreasByDistance(50);

            Assert.IsInstanceOf <UnauthorizedResult>(resut, "Result should be an instance of <UnauthorizedResult>");
        }
Exemple #2
0
        public void AsserThatControllerReturnsUnauthorizedWhenTokenIsInvalid(string token)
        {
            var controller = new AreaController()
            {
                Request = new System.Net.Http.HttpRequestMessage()
            };

            controller.Request.Headers.Add("Authorization", token); var resut = controller.GetAreasByDistance(50);
            Assert.IsInstanceOf <UnauthorizedResult>(resut, "Result should be an instance of <UnauthorizedResult>");
        }