本文整理汇总了C#中IRepositoryFactory.Stub方法的典型用法代码示例。如果您正苦于以下问题:C# IRepositoryFactory.Stub方法的具体用法?C# IRepositoryFactory.Stub怎么用?C# IRepositoryFactory.Stub使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRepositoryFactory
的用法示例。
在下文中一共展示了IRepositoryFactory.Stub方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GlobalArrange
public void GlobalArrange()
{
repoFactory = MockRepository.GenerateMock<IRepositoryFactory>();
factory = MockRepository.GenerateMock<IRepositoryFactoryFactory>();
console = MockRepository.GenerateMock<IConsoleFacade>();
repo = MockRepository.GenerateMock<IRepository>();
uow = MockRepository.GenerateMock<IUnitOfWork>();
goQueries = MockRepository.GenerateMock<IGameObjectQueries>();
//formatters = MockRepository.GenerateMock<IFormatter[]>();
factory.Stub(m => m.Create()).Return(repoFactory);
repoFactory.Stub(m => m.Create()).Return(repo);
repo.Stub(m => m.UnitOfWork).Return(uow);
//target = new LookCommand(console, factory, goQueries, formatters);
}
示例2: Setup
public void Setup()
{
context = new AuthorizationContext
{
HttpContext = new TestControllerBuilder().HttpContext
};
userRepositoryFactory = MockRepository.GenerateStub<IRepositoryFactory<User>>();
userRepository = MockRepositoryBuilder.CreateUserRepository();
userRepositoryFactory.Stub(x => x.Resolve()).Return(userRepository).Repeat.Any();
formsAuth = MockRepository.GenerateStub<IFormsAuthentication>();
filter = new AuthenticateFilter(formsAuth, userRepositoryFactory);
originalPrincipal = Thread.CurrentPrincipal;
}