本文整理汇总了C#中IConfigurationService.Stub方法的典型用法代码示例。如果您正苦于以下问题:C# IConfigurationService.Stub方法的具体用法?C# IConfigurationService.Stub怎么用?C# IConfigurationService.Stub使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IConfigurationService
的用法示例。
在下文中一共展示了IConfigurationService.Stub方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Setup
public void Setup()
{
mr = new MockRepository();
sc = new ServiceContainer();
eventListener = new FakeDecompilerEventListener();
cfgSvc = mr.Stub<IConfigurationService>();
signatureFiles = new List<SignatureFile>();
sc.AddService<DecompilerEventListener>(eventListener);
sc.AddService<IConfigurationService>(cfgSvc);
cfgSvc.Stub(d => d.GetSignatureFiles()).Return(signatureFiles);
}
示例2: InitServices
private void InitServices(List<Golfer> unassigned, List<MastersParticipant> participants)
{
if(null == unassigned)
{
unassigned = new List<Golfer>();
}
if(null == participants)
{
participants = new List<MastersParticipant>();
}
golferService = MockRepository.GenerateStub<IGolferService>();
configService = MockRepository.GenerateStub<IConfigurationService>();
golferService.Stub(gs => gs.GetAllGolfers()).Return(unassigned);
golferService.Stub(gs => gs.GetMastersParticipantsByYear(2009)).Return(participants);
configService.Stub(cs => cs.GetConfigurationByKey("CurrentYear"))
.Return(new MastersConfiguration { ConfigKey = "CurrentYear", ConfigValue = "2009" });
}
示例3: Setup
public void Setup()
{
this.mr = new MockRepository();
this.arch = mr.Stub<IProcessorArchitecture>();
this.services = mr.Stub<IServiceProvider>();
this.dcSvc = mr.Stub<IConfigurationService>();
this.tlSvc = mr.Stub<ITypeLibraryLoaderService>();
services.Stub(s => s.GetService(typeof(IConfigurationService))).Return(dcSvc);
services.Stub(s => s.GetService(typeof(ITypeLibraryLoaderService))).Return(tlSvc);
dcSvc.Stub(d => d.GetArchitecture("x86-protected-32")).Return(arch);
dcSvc.Stub(d => d.GetEnvironment("elf-neutral")).Return(new OperatingEnvironmentElement
{
TypeName = typeof(SysVPlatform).AssemblyQualifiedName
});
}