Example #1
0
        public void CanGetUserRolesOnNewAccount()
        {
            String username = "******";
            String password = "******";

            AccountRegistrationRequest request = new AccountRegistrationRequest()
            {
                Email    = "*****@*****.**",
                Password = password,
                Username = username,
            };

            AccountRegistrationResponse response = client.RegisterAccount(request);

            Assert.IsTrue(response.Token != null);
            Assert.IsTrue(response.User.Id != null);
            Assert.AreEqual(response.User.Username, username);

            GetRolesResponse roleResponse = client.GetRoles(new GetRolesRequest()
            {
            });

            Assert.IsTrue(roleResponse.Status.IsSuccess);
            Assert.IsTrue(roleResponse.Claims.Contains(UserClaim.User));
            Assert.IsFalse(roleResponse.Claims.Contains(UserClaim.Admin));
        }