コード例 #1
0
        public async Task LoginUser()
        {
            var obj = new CB.CloudUser();

            obj.Set("username", CB.Test.Util.Methods.MakeEmail());
            obj.Set("password", CB.Test.Util.Methods.MakeEmail());
            obj.Set("email", CB.Test.Util.Methods.MakeEmail());

            await obj.SignupAsync();

            await obj.LogoutAsync();

            await obj.LoginAsync();

            if (obj.Username == username && CB.CloudUser.Current != null)
            {
                Assert.IsTrue(true);
            }
            else
            {
                Assert.Fail("User Login Error");
            }
        }
コード例 #2
0
        public async Task RemoveRoleAssignRoleToUser()
        {
            var obj      = new CB.CloudUser();
            var roleName = Util.Methods.MakeString();
            var role     = new CB.CloudRole(roleName);

            role.Set("name", roleName);
            obj.Set("username", CB.Test.Util.Methods.MakeEmail());
            obj.Set("password", CB.Test.Util.Methods.MakeEmail());
            obj.Set("email", CB.Test.Util.Methods.MakeEmail());
            await obj.SignupAsync();

            await obj.LogoutAsync();

            await obj.LoginAsync();

            await role.SaveAsync();

            await obj.AddToRoleAsync(role);

            await CB.CloudUser.Current.RemoveFromRoleAsync(role);

            Assert.IsTrue(true);
        }