本文整理汇总了C#中IDependencyResolver.Stub方法的典型用法代码示例。如果您正苦于以下问题:C# IDependencyResolver.Stub方法的具体用法?C# IDependencyResolver.Stub怎么用?C# IDependencyResolver.Stub使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDependencyResolver
的用法示例。
在下文中一共展示了IDependencyResolver.Stub方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Arrange
public void Arrange()
{
_resolver = MockRepository.GenerateMock<IDependencyResolver>();
_repository = MockRepository.GenerateMock<IRepository<TestEntity>>();
_resolver.Stub(m => m.GetService(typeof(IRepository<TestEntity>))).Return(_repository);
_entityBinder = new EntityBinder(_resolver);
}
示例2: Before_each_spec
protected override void Before_each_spec()
{
packageTree = TreeHelper.GetTempPackageTree();
get = MockRepository.GenerateStub<IGet>();
repositoryElement = new RepositoryElementStub("castle", "Tools", "Tools");
dependencyResolver = CreateStub<IDependencyResolver>();
dependencyResolver.Stub(x => x.Resolve<IBuildConfigReader>()).Return(new BooBuildConfigReader());
var svn = new SVNSourceControl("http://svnserver/trunk");
get.Stub(x => x.From(svn)).Return(get);
dependencyResolver.Stub(x => x.Resolve<SVNSourceControl>()).Return(svn);
IoC.InitializeWith(dependencyResolver);
}
示例3: Before_each_spec
protected override void Before_each_spec()
{
dependencyResolver = CreateStub<IDependencyResolver>();
dependencyResolver.Stub(x => x.Resolve<SVNSourceControl>()).Return(new SVNSourceControl(string.Empty));
IoC.InitializeWith(dependencyResolver);
factory = new DslFactory { BaseDirectory = DirectoryHelper.GetBaseDirectory() };
factory.Register<BooConfigReader>(new ConfigReaderEngine());
packageTree = MockRepository.GenerateStub<IPackageTree>();
}
示例4: Before_each_spec
protected override void Before_each_spec()
{
dependencyResolver = CreateStub<IDependencyResolver>();
dependencyResolver.Stub(x => x.Resolve<SVNSourceControl>())
.Return(new SourceControlDouble(string.Empty));
IoC.InitializeWith(dependencyResolver);
GetTestBuildConfigsFolder();
rootDirectory = GetTestBuildConfigsFolder();
packageTree = new PackageTree(rootDirectory, null);
}
示例5: Before_each_spec
protected override void Before_each_spec()
{
dependencyResolver = CreateStub<IDependencyResolver>();
var environmentVariable = CreateStub<IEnvironmentVariable>();
environmentVariable.Stub(x => x.GetDirectoryFor("git.cmd")).Return(Environment.CurrentDirectory);
dependencyResolver.Stub(x => x.Resolve<GitSourceControl>()).Return(new GitSourceControl(environmentVariable));
IoC.InitializeWith(dependencyResolver);
factory = new DslFactory { BaseDirectory = DirectoryHelper.GetBaseDirectory() };
factory.Register<BooConfigReader>(new ConfigReaderEngine());
packageTree = MockRepository.GenerateStub<IPackageTree>();
}
示例6: Before_each_spec
protected override void Before_each_spec()
{
IBuildConfigReader buildConfigReader = new BooBuildConfigReader();
dependencyResolver = CreateStub<IDependencyResolver>();
dependencyResolver.Stub(x => x.Resolve<IBuildConfigReader>()).Return(buildConfigReader);
var svn = new SVNSourceControl("http://svnserver/trunk");
dependencyResolver.Stub(x => x.Resolve<SVNSourceControl>()).Return(svn);
IoC.InitializeWith(dependencyResolver);
}