public void AuthentificationTest()
        {
            var cwd = new CrowdClient(TestData.CrowdUri, TestData.AppName, TestData.AppPassword);

            IRestResponse <User> response = cwd.AuthenticateUser(TestData.UserName, TestData.UserPassword);

            Assert.IsTrue(response.IsSuccessful);
            Assert.NotNull(response.Data);
        }
예제 #2
0
        public void AuthentificationTest()
        {
            var cwd     = new CrowdClient(TestData.CrowdUri, TestData.AppName, TestData.AppPassword);
            var context = new AuthenticationContext
            {
                UserName = TestData.UserName,
                Password = TestData.UserPassword
            };

            IRestResponse <string> response = cwd.AuthenticateUser(context);

            Assert.IsTrue(response.IsSuccessful);
            Assert.NotNull(response.Data);
        }
예제 #3
0
        public void TokenValidationTest()
        {
            var cwd     = new CrowdClient(TestData.CrowdUri, TestData.AppName, TestData.AppPassword);
            var context = new AuthenticationContext
            {
                UserName = TestData.UserName,
                Password = TestData.UserPassword
            };

            IRestResponse <string> response1 = cwd.AuthenticateUser(context);
            string token = response1.Data;

            IRestResponse response2 = cwd.IsTokenValid(token);

            Assert.IsTrue(response2.IsSuccessful);
        }
예제 #4
0
        public void FindUserFromTokenTest()
        {
            var cwd     = new CrowdClient(TestData.CrowdUri, TestData.AppName, TestData.AppPassword);
            var context = new AuthenticationContext
            {
                UserName = TestData.UserName,
                Password = TestData.UserPassword
            };

            IRestResponse <string> response1 = cwd.AuthenticateUser(context);
            string token = response1.Data;

            IRestResponse <User> response2 = cwd.FindUserFromToken(token);

            Assert.IsTrue(response2.IsSuccessful);
            Assert.NotNull(response2.Data);
            Assert.AreEqual(response2.Data?.Name, TestData.UserName);
        }