예제 #1
0
        public void AnonymousUserCannotCreateView()
        {
            var query   = "SELECT * FROM Computers";
            var expires = DateTime.UtcNow.AddMinutes(3);
            var noLoginDataApiClient = new DataApiClient(ApiSetup.ApiConfiguration)
            {
                LoginMethod = LoginMethod.JsonWebToken
            };

            AssertStatusCode(
                () => noLoginDataApiClient.CreateViewAsync(query, expires).Wait(),
                HttpStatusCode.Unauthorized);
        }