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


C# IDependencyResolver.Stub方法代码示例

本文整理汇总了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);
 }
开发者ID:brocksamson,项目名称:Evil,代码行数:7,代码来源:When_binding_an_entity.cs

示例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);
        }
开发者ID:emmekappa,项目名称:horn_src,代码行数:20,代码来源:RepositoryElementSpecBase.cs

示例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>();
        }
开发者ID:kkozmic,项目名称:horn_src,代码行数:12,代码来源:BuildWithBatchSpecificationBase.cs

示例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);
        }
开发者ID:emmekappa,项目名称:horn_src,代码行数:14,代码来源:BuildConfigReaderSpecification.cs

示例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>();
        }
开发者ID:kkozmic,项目名称:horn_src,代码行数:14,代码来源:GitSourceControlSpecificationBase.cs

示例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);
        }
开发者ID:kkozmic,项目名称:horn_src,代码行数:14,代码来源:PackageTreeSpecification.cs


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