本文整理汇总了C#中IPlatform.Replay方法的典型用法代码示例。如果您正苦于以下问题:C# IPlatform.Replay方法的具体用法?C# IPlatform.Replay怎么用?C# IPlatform.Replay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPlatform
的用法示例。
在下文中一共展示了IPlatform.Replay方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreatePlatform
public IPlatform CreatePlatform()
{
if (platform != null)
return platform;
platform = mr.Stub<IPlatform>();
platform.Stub(p => p.Name).Return("TestPlatform");
platform.Stub(p => p.PointerType).Return(PrimitiveType.Pointer32);
platform.Stub(p => p.GetByteSizeFromCBasicType(CBasicType.Char)).Return(1);
platform.Stub(p => p.GetByteSizeFromCBasicType(CBasicType.Short)).Return(2);
platform.Stub(p => p.GetByteSizeFromCBasicType(CBasicType.Int)).Return(4);
platform.Stub(p => p.GetByteSizeFromCBasicType(CBasicType.Long)).Return(4);
platform.Stub(p => p.GetByteSizeFromCBasicType(CBasicType.LongLong)).Return(8);
platform.Stub(p => p.GetByteSizeFromCBasicType(CBasicType.Float)).Return(4);
platform.Stub(p => p.GetByteSizeFromCBasicType(CBasicType.Double)).Return(8);
platform.Stub(p => p.GetByteSizeFromCBasicType(CBasicType.LongDouble)).Return(8);
platform.Stub(p => p.GetByteSizeFromCBasicType(CBasicType.Int64)).Return(8);
platform.Stub(p => p.CreateMetadata()).Do(new Func<TypeLibrary>(() => this.platformMetadata.Clone()));
var arch = new X86ArchitectureFlat32();
platform.Stub(p => p.Architecture).Return(arch);
platform.Stub(p => p.DefaultCallingConvention).Return("__cdecl");
platform.Stub(s => s.CreateProcedureSerializer(null, null)).IgnoreArguments().Do(
new Func<ISerializedTypeVisitor<DataType>, string, ProcedureSerializer>((tlDeser, dc) =>
new X86ProcedureSerializer(arch, tlDeser, dc)
)
);
platform.Stub(p => p.SaveUserOptions()).Return(null);
platform.Replay();
return platform;
}
示例2: Given_Platform
private void Given_Platform()
{
platform = mr.Stub<IPlatform>();
platform.Stub(p => p.LookupProcedureByName("", "")).IgnoreArguments().Return(new ExternalProcedure("", null));
platform.Replay();
}