本文整理汇总了C#中IWindsorContainer.Expect方法的典型用法代码示例。如果您正苦于以下问题:C# IWindsorContainer.Expect方法的具体用法?C# IWindsorContainer.Expect怎么用?C# IWindsorContainer.Expect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWindsorContainer
的用法示例。
在下文中一共展示了IWindsorContainer.Expect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeTest
public void InitializeTest()
{
_TestTransaction = new TransactionScope();
try
{
IRepositoryContainer educationContainer = MockRepository.GenerateMock<IRepositoryContainer>();
EducationDataContext = new EducationDataContext();
educationContainer.Expect(m => m.Obtain<IUserRepository>()).Return(new UserRepository(EducationDataContext));
educationContainer.Expect(m => m.Obtain<IEulaAgreementRepository>()).Return(new EulaAgreementRepository(EducationDataContext));
MockWindsorContainer = MockRepository.GenerateMock<IWindsorContainer>();
MockWindsorContainer.Expect(m => m.Resolve<IRepositoryContainer>()).Return(educationContainer);
AccountManager = new AccountManager(MockWindsorContainer, MockRepository.GenerateMock<IEmailConfirmationManager>(), new DataTableBinder(), new UserAuditor());
MockDependecyResolver = MockRepository.GenerateMock<IDependencyResolver>();
MockDependecyResolver.Expect(m => m.GetService(typeof(IAccountManager))).Return(AccountManager);
DependencyResolver.SetResolver(MockDependecyResolver);
}
catch (Exception)
{
_TestTransaction.Dispose();
_TestTransaction = null;
if (EducationDataContext != null)
{
EducationDataContext.Dispose();
EducationDataContext = null;
}
throw;
}
}
开发者ID:modulexcite,项目名称:StudentSuccessDashboard,代码行数:28,代码来源:AuthenticateAndAuthorizeAttributeTest.cs