Esempio n. 1
0
        public void GetAuthUrl_ShouldFailWhenNoRedirectUrl()
        {
            var repo = new MockApplicationRepository();
            var api  = new ApiController(repo);

            var authModel = new ApplicationAuthModel
            {
                ClientId     = "clientid2",
                ClientSecret = "clientsecret2"
            };

            var response = api.GetAuthUrl(authModel);
            var result   = response as NotFoundObjectResult;

            Assert.Equal(404, result.StatusCode);
        }
Esempio n. 2
0
        public void GetAuthUrl_Should404WithWrongID()
        {
            var repo = new MockApplicationRepository();
            var api  = new ApiController(repo);

            var authModel = new ApplicationAuthModel
            {
                ClientId     = "fakeId",
                ClientSecret = "clientsecret1"
            };

            var response = api.GetAuthUrl(authModel);
            var result   = response as NotFoundObjectResult;

            Assert.Equal(404, result.StatusCode);
        }