本文整理汇总了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());
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
示例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();
}
示例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);
}
示例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();
}
示例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);
}
示例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");
}
示例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);
}
示例12: SearchControllerTestsSetup
public void SearchControllerTestsSetup()
{
_searchViewModel = MockRepository.GenerateMock<SearchViewModel>();
_configMgr = MockRepository.GenerateMock<IConfiguration>();
_configMgr.Stub(x => x.GetDefaultSearchResultPageSize()).Return(25);
}
示例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},
};
}