コード例 #1
0
ファイル: CloudUser.cs プロジェクト: enshivam/.net-sdk
        public async Task assignRoleToUser()
        {
            var roleName = Util.Methods._makeString();
            var role     = new CB.CloudRole(roleName);

            role.Set("name", roleName);
            var obj = new CB.CloudUser();

            obj.Set("username", username);
            obj.Set("password", password);
            await obj.Login();

            await role.SaveAsync();

            await obj.AddToRole(role);

            Assert.IsTrue(true);
        }
コード例 #2
0
        public async Task AssignRoleToUser()
        {
            var roleName = Util.Methods.MakeString();
            var role     = new CB.CloudRole(roleName);

            role.Set("name", roleName);
            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 role.SaveAsync();

            await obj.AddToRoleAsync(role);

            Assert.IsTrue(true);
        }