当前位置: 首页>>代码示例>>C#>>正文


C# UserRepository.Refresh方法代码示例

本文整理汇总了C#中UserRepository.Refresh方法的典型用法代码示例。如果您正苦于以下问题:C# UserRepository.Refresh方法的具体用法?C# UserRepository.Refresh怎么用?C# UserRepository.Refresh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserRepository的用法示例。


在下文中一共展示了UserRepository.Refresh方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ActivateAccountTest

 public void ActivateAccountTest()
 {
     IUserService accountSrv = new UserService();
     UserAppService target = new UserAppService(accountSrv);
     using (UserRepository repository = new UserRepository())
     {
         Guid accountId = new Guid("D1111C18-A0BD-480B-99CA-AAF50B2D1818");
         var account = repository.Get(accountId);
         string activationCode = account.ActivationCode;
         target.ActivateAccount(accountId, activationCode);
         repository.Refresh(account);
         Assert.AreEqual(account.IsActive, true);
     }
 }
开发者ID:BruceZhangGit,项目名称:UniversityDream,代码行数:14,代码来源:AccountAppServiceTest.cs

示例2: RechargeTest

 public void RechargeTest()
 {
     IUserService accountSrv = new UserService();
     UserAppService target = new UserAppService(accountSrv);
     UserRepository accountRepository = new UserRepository();
     int original = 0;
     Guid accountId = new Guid("D1111C18-A0BD-480B-99CA-AAF50B2D1818");
     var account = accountRepository.Get(accountId);
     original = account.Coins;
     int coins = 10;
     target.Recharge(account.Id, coins);
     accountRepository.Refresh(account);
     Assert.AreEqual(original + coins, account.Coins);
 }
开发者ID:BruceZhangGit,项目名称:UniversityDream,代码行数:14,代码来源:AccountAppServiceTest.cs

示例3: ResetPasswordTest

 public void ResetPasswordTest()
 {
     IUserService accountSrv = new UserService();
     UserAppService target = new UserAppService(accountSrv);
     Guid accountId = new Guid("D1111C18-A0BD-480B-99CA-AAF50B2D1818");
     UserRepository accountRepository = new UserRepository();
     var account = accountRepository.Get(accountId);
     var password = account.Password;
     target.ResetPassword(accountId, "[email protected]");
     accountRepository.Refresh(account);
     Assert.AreNotEqual(account.Password, password);
 }
开发者ID:BruceZhangGit,项目名称:UniversityDream,代码行数:12,代码来源:AccountAppServiceTest.cs

示例4: ChangePasswordTest

 public void ChangePasswordTest()
 {
     IUserService accountSrv = new UserService();
     UserRepository accountRepository = new UserRepository();
     UserAppService target = new UserAppService(accountSrv);
     Guid accountId = new Guid("D1111C18-A0BD-480B-99CA-AAF50B2D1818");
     var account = accountRepository.Get(accountId);
     string password = "abc123";
     target.ChangePassword(accountId, "123456", password);
     accountRepository.Refresh(account);
     Assert.AreEqual(account.Password, DataCryptography.EncryptString(password));
 }
开发者ID:BruceZhangGit,项目名称:UniversityDream,代码行数:12,代码来源:AccountAppServiceTest.cs


注:本文中的UserRepository.Refresh方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。