public async Task ShouldEncryptUserPassword() { var obj = new CB.CloudUser(); obj.Set("username", CB.Test.Util.Methods.MakeEmail()); obj.Set("password", CB.Test.Util.Methods.MakeEmail()); obj.Set("email", Util.Methods.MakeEmail()); await obj.SaveAsync(); Assert.IsTrue(true); }
public async Task loginUser() { var obj = new CB.CloudUser(); obj.Set("username", username); obj.Set("password", password); await obj.Login(); if (obj.Username == username) { Assert.IsTrue(true); } else { Assert.Fail("user login error"); } }
public async Task shouldEncryptUserPassword() { var obj = new CB.CloudUser(); obj.Set("username", username); obj.Set("password", password); obj.Set("email", Util.Methods._makeEmail()); await obj.SaveAsync(); if (obj.Password == username) { Assert.IsTrue(true); } else { Assert.Fail("Error Creating User"); } }
public async Task createNewUser() { var obj = new CB.CloudUser(); obj.Set("username", username); obj.Set("password", password); obj.Set("email", Util.Methods._makeEmail()); await obj.Signup(); if (obj.Username == username) { Assert.IsTrue(true); } else { Assert.Fail("Error Creating User"); } }
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); }
public async Task createNewUserWithVersion() { var username = "******"; var passwd = "abcd"; var email = "*****@*****.**"; var user = new CB.CloudUser(); user.Set("username", username); user.Set("password", passwd); user.Set("email", email); user = await user.Signup(); if (user.Get("username").ToString() == username && (int)user.Get("_version") >= 0) { Assert.IsTrue(true); } Assert.IsFalse(true); }
public async Task createUserAndGetVersion() { username = Util.Methods._makeString(); var obj = new CB.CloudUser(); obj.Set("username", username); obj.Set("password", password); obj.Set("email", Util.Methods._makeEmail()); await obj.Signup(); if (obj.Username == username && (int)obj.Get("_version") >= 0) { Assert.IsTrue(true); } else { Assert.Fail("Error Creating User"); } }
public async Task CreateUserAndGetVersion() { username = Util.Methods.MakeString(); var obj = new CB.CloudUser(); obj.Set("username", Util.Methods.MakeEmail()); obj.Set("password", Util.Methods.MakeEmail()); obj.Set("email", Util.Methods.MakeEmail()); await obj.SignupAsync(); if (Int32.Parse(obj.Get("_version").ToString()) >= 0) { Assert.IsTrue(true); } else { Assert.Fail("Error Creating User"); } }
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); }
public async Task createNewUserSave() { var obj = new CB.CloudUser(); obj.Set("username", username); obj.Set("password", password); obj.Set("email", Util.Methods._makeEmail()); await obj.SaveAsync(); var query = new CB.CloudQuery("User"); var response = await query.GetAsync(obj.ID); if (response != null) { Assert.IsTrue(true); } else { Assert.Fail("Unable to retrieve User"); } }
public async Task CreateNewUserWithVersion() { var username = CB.Test.Util.Methods.MakeEmail(); var passwd = "abcd"; var email = CB.Test.Util.Methods.MakeEmail(); var user = new CB.CloudUser(); user.Set("username", username); user.Set("password", passwd); user.Set("email", email); user = await user.SignupAsync(); if (user.Get("username").ToString() == username && Int32.Parse(user.Get("_version").ToString()) >= 0) { Assert.IsTrue(true); } else { Assert.IsFalse(true); } }
public async Task queryOnUser() { username = Util.Methods._makeString(); var obj = new CB.CloudUser(); obj.Set("username", username); obj.Set("password", password); obj.Set("email", Util.Methods._makeEmail()); await obj.Signup(); if (obj.Username == username && (int)obj.Get("_version") >= 0) { var query = new CB.CloudQuery("User"); var response = await query.GetAsync(obj.ID); Assert.IsTrue(true); } else { Assert.Fail("Error Creating User"); } }
public async Task QueryOnUser() { username = Util.Methods.MakeString(); var obj = new CB.CloudUser(); obj.Set("username", Util.Methods.MakeEmail()); obj.Set("password", Util.Methods.MakeEmail()); obj.Set("email", Util.Methods.MakeEmail()); await obj.SignupAsync(); if (Int32.Parse(obj.Get("_version").ToString()) >= 0) { var query = new CB.CloudQuery("User"); var response = await query.GetAsync <CB.CloudUser>(obj.ID); Assert.IsTrue(true); } else { Assert.Fail("Error Creating User"); } }
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"); } }