public void UpdateUser() { var userInfo = new User() { Email = "*****@*****.**", IsFacebookUser = false, AcceptedTerms = true, Name = "Kenji" }; userInfo.GuidKey = GuidGenerate.USER_ID; var userClient = new UserClient(); var apiResponse = userClient.GetByObj(userInfo); if (apiResponse.IsSuccess) { userInfo.Password = PasswordGenerate.Encryption("321"); apiResponse = userClient.Update(userInfo); } Assert.IsTrue(apiResponse.IsSuccess); }
static void Main(string[] args) { try { var userClient = new UserClient(); var userInfo1 = new User() { Email = "*****@*****.**", IsFacebookUser = false, AcceptedTerms = true, Password = PasswordGenerate.Encryption("321") }; userInfo1.GuidKey = GuidGenerate.USER_ID; var apiResponse = userClient.Login(userInfo1); if (!apiResponse.IsSuccess) { return; } // user insert var userInfo = new User() { Email = "*****@*****.**", IsFacebookUser = false, AcceptedTerms = true, Name = "alvin", Password = PasswordGenerate.Encryption("123456") }; apiResponse = userClient.Add(userInfo); if (!apiResponse.IsSuccess) { return; } // teste get apiResponse = userClient.GetByObj(userInfo); var userGet = apiResponse.Data; userGet.Name = "Alvin Rezende"; apiResponse = userClient.Update(userGet); // account add var accountClient = new AccountClient(); var accountInfo = new Account() { User = userInfo, Birthday = DateTime.Now, City = "Patrocínio", GamerTag = "@rezenboy", State = "SP", StartingDate = DateTime.Now }; var apiResponseAccount = accountClient.Add(accountInfo); if (!apiResponseAccount.IsSuccess) { return; } // teste update if (apiResponseAccount.IsSuccess) { accountInfo.FavorityGame = Raise.Enums.Games.COD; apiResponseAccount = accountClient.Update(accountInfo); } // teste get feed //if (apiResponseAccount.IsSuccess) //{ // var feedClient = new FeedClient(); // var feedInfo = new Feed() { GuidKey = GuidGenerate.USER_ID }; // var lst = feedClient.GetByObj(feedInfo); //} apiResponse = userClient.GetAll(); } catch (Exception exc) { } }
public void AddUser() { var userClient = new UserClient(); var userInfo = new User() { Email = "*****@*****.**", IsFacebookUser = false, AcceptedTerms = true, Name = "Alvin", Password = PasswordGenerate.Encryption("321") }; userInfo.GuidKey = GuidGenerate.USER_ID; var apiResponse = userClient.Add(userInfo); Assert.IsTrue(apiResponse.IsSuccess); }