public void RegisterForInterface_ReturnImplementationWithMirrorProto_SuccessfullyCallInterface() { OmniShim.RegisterMirrorProto <OtherData>("omnishim_test_core.SomeData"); var wrapType = OmniShim.RegisterForInterface <ProtoMirrorClass>("omnishim_test_core.IProtoInterface"); IProtoInterface transform = (IProtoInterface)Activator.CreateInstance(wrapType); Assert.AreEqual(new SomeData() { Name = "OtherDataOutput", }, transform.GetThing()); }
public void RegisterForInterface_ReturnImplementationWithProto_SuccessfullyCallInterface() { var wrapType = OmniShim.RegisterForInterface <ProtoRegisterClass>("omnishim_test_core.IProtoInterface"); IProtoInterface transform = (IProtoInterface)Activator.CreateInstance(wrapType); Assert.AreEqual(new SomeData() { Name = "SomeDataOutput", Number = 1.1, Fixed = 2, }, transform.GetThing()); }
public void RegisterForInterface_ImplementationWithMirrorProto_SuccessfullyCallInterface() { OmniShim.RegisterMirrorProto <OtherData>("omnishim_test_core.SomeData"); var wrapType = OmniShim.RegisterForInterface <ProtoMirrorClass>("omnishim_test_core.IProtoInterface"); IProtoInterface transform = (IProtoInterface)Activator.CreateInstance(wrapType); Assert.AreEqual("test1", transform.DoThing(new SomeData() { Name = "test1", Number = 5.3, Fixed = 2, })); }