本文整理汇总了C#中IServiceProvider.Replay方法的典型用法代码示例。如果您正苦于以下问题:C# IServiceProvider.Replay方法的具体用法?C# IServiceProvider.Replay怎么用?C# IServiceProvider.Replay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IServiceProvider
的用法示例。
在下文中一共展示了IServiceProvider.Replay方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Setup
public void Setup()
{
mr = new MockRepository();
this.services = mr.Stub<IServiceProvider>();
var tlSvc = new TypeLibraryLoaderServiceImpl(services);
var configSvc = mr.StrictMock<IConfigurationService>();
var win32env = new OperatingEnvironmentElement
{
TypeLibraries =
{
new TypeLibraryElement { Name= "msvcrt.xml" },
new TypeLibraryElement { Name= "windows32.xml" },
}
};
configSvc.Stub(c => c.GetEnvironment("win32")).Return(win32env);
configSvc.Stub(c => c.GetInstallationRelativePath(null)).IgnoreArguments()
.Do(new Func<string[], string>(s => string.Join("/", s)));
services.Stub(s => s.GetService(typeof(ITypeLibraryLoaderService))).Return(tlSvc);
services.Stub(s => s.GetService(typeof(IConfigurationService))).Return(configSvc);
services.Stub(s => s.GetService(typeof(DecompilerEventListener))).Return(new FakeDecompilerEventListener());
services.Stub(s => s.GetService(typeof(CancellationTokenSource))).Return(null);
services.Stub(s => s.GetService(typeof(IFileSystemService))).Return(new FileSystemServiceImpl());
services.Stub(s => s.GetService(typeof(IDiagnosticsService))).Return(new FakeDiagnosticsService());
services.Replay();
configSvc.Replay();
arch = new X86ArchitectureFlat32();
win32 = new Reko.Environments.Windows.Win32Platform(services, arch);
}
示例2: Setup
public void Setup()
{
mr = new MockRepository();
this.services = mr.Stub<IServiceProvider>();
var tlSvc = mr.Stub<ITypeLibraryLoaderService>();
var configSvc = mr.StrictMock<IConfigurationService>();
var win32env = new OperatingEnvironmentElement
{
TypeLibraries =
{
new TypeLibraryElement { Name= "msvcrt.xml" },
new TypeLibraryElement { Name= "windows32.xml" },
}
};
configSvc.Stub(c => c.GetEnvironment("win32")).Return(win32env);
configSvc.Stub(c => c.GetPath(null)).IgnoreArguments()
.Do(new Func<string, string>(s => s));
services.Stub(s => s.GetService(typeof(ITypeLibraryLoaderService))).Return(tlSvc);
services.Stub(s => s.GetService(typeof(IConfigurationService))).Return(configSvc);
services.Stub(s => s.GetService(typeof(DecompilerEventListener))).Return(new FakeDecompilerEventListener());
services.Stub(s => s.GetService(typeof(CancellationTokenSource))).Return(null);
tlSvc.Stub(t => t.LoadLibrary(null, null)).IgnoreArguments()
.Do(new Func<Platform, string, TypeLibrary>((p, n) =>
{
var lib = TypeLibrary.Load(p, Path.ChangeExtension(n, ".xml"));
return lib;
}));
services.Replay();
tlSvc.Replay();
configSvc.Replay();
arch = new IntelArchitecture(ProcessorMode.Protected32);
win32 = new Reko.Environments.Windows.Win32Platform(services, arch);
}