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


C# IConfiguration.Stub方法代码示例

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


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

示例1: Setup

        public void Setup()
        {
            _config = MockRepository.GenerateStub<IConfiguration>();
            _storage = MockRepository.GenerateStub<IStorageDocument<FakeObject>>();

            _config.Stub(c => c.DependencyResolver).Return(new FakeDependencyResolver());
        }
开发者ID:robertgregorywest,项目名称:SimpleDatastore,代码行数:7,代码来源:CacheHelperTests.cs

示例2: GetNewDataContext

 protected DataContext GetNewDataContext(string databaseName, Assembly domainAssembly)
 {
     _configuration = CreateStub<IConfiguration>();
     _configuration.Stub(c => c.ConnectionString).Return(databaseName.GetConnectionString()).Repeat.Any();
     _attributeMappingSource = CreateStub<IAttributeMappingSource>();
     _attributeMappingSource.Stub(x => x.MappingAssemblies).Return(new List<Assembly> { domainAssembly }).Repeat.Any();
     return new DataContext(_configuration, _attributeMappingSource);
 }
开发者ID:consumentor,项目名称:Server,代码行数:8,代码来源:DatabaseSpecBase.cs

示例3: testSetup

 public void testSetup()
 {
     _services = MockRepository.GenerateMock<IServiceLocator>();
     _bus = MockRepository.GenerateMock<IMessageBus>();
     _config = MockRepository.GenerateMock<IConfiguration>();
     _config.Stub(x => x.Providers).Return(".NET");
     _subject = new FileChangeConsumer(_services, _bus, _config);
 }
开发者ID:jeroldhaas,项目名称:ContinuousTests,代码行数:8,代码来源:FileChangeConsumerTest.cs

示例4: SetUp

        public void SetUp()
        {
            _messageBus = MockRepository.GenerateMock<IMessageBus>();
            _validator = MockRepository.GenerateMock<IWatchValidator>();
			_configuration = MockRepository.GenerateMock<IConfiguration>();
            _pathLocator = MockRepository.GenerateMock<IWatchPathLocator>();
            _configuration.Stub(x => x.IgnoreFile).Return("");
			_validator.Stub(v => v.GetIgnorePatterns()).Return("");
			_configuration.Stub(c => c.FileChangeBatchDelay).Return(50);
            _watcher = new DirectoryWatcher(_messageBus, _validator, _configuration, MockRepository.GenerateMock<IHandleDelayedConfiguration>(), _pathLocator);
            _file = Path.GetFullPath("watcher_test.txt");
            _directory = Path.GetFullPath("mytestfolder");
			_watchDirectory = Path.GetDirectoryName(_file);
            _pathLocator.Stub(x => x.Locate(_watchDirectory)).Return(_watchDirectory);
			_localConfig = Path.Combine(_watchDirectory, "AutoTest.config");
			File.WriteAllText(_localConfig, "<configuration></configuration>");
            _watcher.Watch(_watchDirectory);
        }
开发者ID:gtejeda,项目名称:AutoTest.Net,代码行数:18,代码来源:DirectoryWatcherTests.cs

示例5: SetupDatabase

 public void SetupDatabase(string databaseName, Assembly domainAssembly)
 {
     _databaseName = databaseName;
     _configuration = CreateStub<IConfiguration>();
     _configuration.Stub(c => c.ConnectionString).Return(databaseName.GetConnectionString()).Repeat.Any();
     _attributeMappingSource = CreateStub<IAttributeMappingSource>();
     _attributeMappingSource.Stub(x => x.MappingAssemblies).Return(new List<Assembly> { domainAssembly }).Repeat.Any();
     ReCreateDatabaseFromAttributeMapping(GetNewDataContext());
 }
开发者ID:consumentor,项目名称:Server,代码行数:9,代码来源:DatabaseSpecBase.cs

示例6: SetUp

		public void SetUp()
		{
			_bus = MockRepository.GenerateMock<IMessageBus>();
			_config = MockRepository.GenerateMock<IConfiguration>();
            _config.Stub(x => x.Providers).Return(".NET");
			_assemblyIdProvider = MockRepository.GenerateMock<IRetrieveAssemblyIdentifiers>();
			_consumer = new BinaryFileChangeConsumer(_bus, _assemblyIdProvider, _config);
			_files = new FileChangeMessage();
		}
开发者ID:jeroldhaas,项目名称:ContinuousTests,代码行数:9,代码来源:BinaryFileChangeConsumerTest.cs

示例7: SetUp

        public void SetUp()
        {
            _messageBus = MockRepository.GenerateMock<IMessageBus>();
            _validator = MockRepository.GenerateMock<IWatchValidator>();
			_configuration = MockRepository.GenerateMock<IConfiguration>();
			_validator.Stub(v => v.GetIgnorePatterns()).Return("");
			_configuration.Stub(c => c.FileChangeBatchDelay).Return(50);
            _watcher = new DirectoryWatcher(_messageBus, _validator, _configuration);
            _file = Path.GetFullPath("watcher_test.txt");
			_watchDirectory = Path.GetDirectoryName(_file);
            _watcher.Watch(_watchDirectory);
        }
开发者ID:nieve,项目名称:AutoTest.Net,代码行数:12,代码来源:DirectoryWatcherTests.cs

示例8: DogsControllerTestsSetup

        public void DogsControllerTestsSetup()
        {
            _dogsRepository = MockRepository.GenerateMock<IRepository<Dog>>();
              _breedsRepository = MockRepository.GenerateMock<IRepository<Breed>>();
              _placesRepository = MockRepository.GenerateMock<IPlacesRepository>();
              _unitofWork = MockRepository.GenerateMock<IUnitOfWork>();
              _dogSearchhelper = MockRepository.GenerateMock<IDogSearchService>();
              _configuration = MockRepository.GenerateMock<IConfiguration>();

              _breedsRepository.Stub(x => x.GetById(Arg<int>.Is.Anything)).Return(
            new Breed {Name = "Beagel"});

              _configuration.Stub(x => x.GetNationwideSearchResultsDescriptionMessageForAllBreeds())
            .Return("Search results {0} to {1} out of {2} results for all breeds nationwide.");
              _configuration.Stub(x => x.GetNationwideSearchResultsDescriptionMessageForSpecificBreed())
            .Return("Showing results {0} to {1} out of {2} results for {3} nationwide");
              _configuration.Stub(x => x.GetLocalSearchResultsDescriptionMessageForAllBreeds())
            .Return("Search results {0} to {1} out of {2} results for all breeds in {3}");

              _dogsController = new DogsController(_dogsRepository, _breedsRepository, _unitofWork, _dogSearchhelper, _configuration, _placesRepository);

              StubDogsRepository();
        }
开发者ID:jegglestone,项目名称:Animal-Store,代码行数:23,代码来源:DogsControllerTests.cs

示例9: SetUp

        public void SetUp()
        {
			_launcer = MockRepository.GenerateMock<IApplicatonLauncher>();
            _messageBus = MockRepository.GenerateMock<IMessageBus>();
            _validator = MockRepository.GenerateMock<IWatchValidator>();
			_configuration = MockRepository.GenerateMock<IConfiguration>();
            _pathLocator = MockRepository.GenerateMock<IWatchPathLocator>();
            _cahce = MockRepository.GenerateMock<ICache>();
            _slnConsumer = MockRepository.GenerateMock<ISolutionChangeConsumer>();
            _rebuildMarker = MockRepository.GenerateMock<IMarkProjectsForRebuild>();
            _configuration.Stub(x => x.IgnoreFile).Return("");
			_validator.Stub(v => v.GetIgnorePatterns()).Return("");
			_configuration.Stub(c => c.FileChangeBatchDelay).Return(50);
            _configuration.Stub(c => c.WatchAllFiles).Return(true);
            _configuration.Stub(c => c.WatchToken).Return(_watchDirectory);
            _watcher = new DirectoryWatcher(_messageBus, _validator, _configuration, MockRepository.GenerateMock<IHandleDelayedConfiguration>(), _pathLocator, _launcer, _cahce, _rebuildMarker, _slnConsumer);
            _file = Path.GetFullPath("watcher_test.txt");
            _directory = Path.GetFullPath("mytestfolder");
			_watchDirectory = Path.GetDirectoryName(_file);
            _pathLocator.Stub(x => x.Locate(_watchDirectory)).Return(_watchDirectory);
			_localConfig = new PathTranslator(_watchDirectory).Translate(Path.Combine(_watchDirectory, "AutoTest.config"));
			File.WriteAllText(_localConfig, "<configuration></configuration>");
            _watcher.Watch(_watchDirectory);
        }
开发者ID:rlarno,项目名称:AutoTest.Net,代码行数:24,代码来源:DirectoryWatcherTests.cs

示例10: SetupTests

 public void SetupTests()
 {
     _exceptionHandler = MockRepository.GenerateMock<IExceptionHelper>();
     _webAPIRequestWrapper = MockRepository.GenerateMock<IWebAPIRequestWrapper>();
     _configMgr = MockRepository.GenerateMock<IConfiguration>();
     _responseStreamHelper = MockRepository.GenerateMock<IResponseStreamHelper>();
     _configMgr.Stub(x => x.GetWebAPIUrl()).Return("http://www.someAPI.com");
 }
开发者ID:jegglestone,项目名称:Animal-Store,代码行数:8,代码来源:SearchAPIFacadeTests.cs

示例11: SetUp

 public void SetUp()
 {
     _configuration = MockRepository.GenerateMock<IConfiguration>();
     _configuration.Stub(c => c.WatchDirectores).Return(new string[] {"First directory item", "Second directory item"});
     _form = new WatchDirectoryPickerFormExtendedForTests(_configuration);
 }
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:6,代码来源:WatchDirectoryPickerFormTest.cs

示例12: SearchControllerTestsSetup

 public void SearchControllerTestsSetup()
 {
     _searchViewModel = MockRepository.GenerateMock<SearchViewModel>();
     _configMgr = MockRepository.GenerateMock<IConfiguration>();
     _configMgr.Stub(x => x.GetDefaultSearchResultPageSize()).Return(25);
 }
开发者ID:jegglestone,项目名称:Animal-Store,代码行数:6,代码来源:SearchControllerTests.cs

示例13: Setup

            public void Setup()
            {
                _configMgr = MockRepository.GenerateMock<IConfiguration>();
                _configMgr.Stub(x => x.GetDefaultSearchResultPageSize()).Return(25);

                _searchViewModel = MockRepository.GenerateMock<SearchViewModel>();
                _searchViewModel.IsNationalSearch = _isNationalSearch;
                _searchViewModel.SelectedBreed = _selectedBreed;
                _searchViewModel.PageNumber = _pageNumber;

                _dogs = new List<Dog>()
                {
                  new Dog() {AgeInMonths = 3, AgeInYears = 0, Id = 1, IsFemale = false, IsSold = false},
                  new Dog() {AgeInMonths = 15, AgeInYears = 1, Id = 3, IsFemale = true, IsSold = false},
                };
            }
开发者ID:jegglestone,项目名称:Animal-Store,代码行数:16,代码来源:SearchControllerTests.cs


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