public static void RunTest() { IMyInterface myObj = Core.CreateImplementedInstance <IMyInterface, WrapperInterface>(); myObj.TheInt = 123; Assert.Equal("The resulting string is: blabla_123", myObj.GetResultingStr("blabla", 123)); }
public static void RunTest() { IMyInterface myInterfaceObj = Core.CreateImplementedInstance <IMyInterface, WrapperInterface>(); myInterfaceObj.TheInt = 1234; myInterfaceObj.TheStr = "Hello"; string str = myInterfaceObj.GetResultingStr("blabla", 123); Core.Save("GeneratedCode"); Assert.Equal("The resulting string is: blabla_1234", str); }
public static void RunTest() { Core.SetSaveOnErrorPath("GeneratedCode"); ITypeConfig typeConfig = Core.FindOrCreateTypeConfig <IMyInterface, WrapperInterface>("MyGeneratedClass3"); typeConfig.SetMemberMap(nameof(WrapperInterface.TheClass), nameof(MyClass.MyInt), nameof(IMyInterface.TheInt)); //typeConfig.SetPropBuilder(DelegatePropBuilder.TheDelegatePropBuilder, nameof(IMyInterface.TheStr)); typeConfig.ConfigurationCompleted(); IMyInterface myObj = typeConfig.CreateInstanceOfType <IMyInterface>(); myObj.TheInt = 123; Core.Save("GeneratedCode"); Assert.Equal("The resulting string is: blabla_123", myObj.GetResultingStr("blabla", 123)); }
public static void RunTest() { Core.SetSaveOnErrorPath("GeneratedCode"); ITypeConfig typeConfig = Core.FindOrCreateTypeConfig <IMyInterface, WrapperInterface>("MyGeneratedClass1"); typeConfig.SetMemberMap(nameof(WrapperInterface.TheClass), nameof(MyClass.MyInt), nameof(IMyInterface.TheInt)); typeConfig.SetMemberMap(nameof(WrapperInterface.TheClass), nameof(MyClass.MyStr), nameof(IMyInterface.TheStr)); typeConfig.ConfigurationCompleted(); Core.Save("GeneratedCode"); IMyInterface myInterfaceObj = typeConfig.CreateInstanceOfType <IMyInterface>(); myInterfaceObj.TheInt = 1234; myInterfaceObj.TheStr = "Hello"; string str = myInterfaceObj.GetResultingStr("blabla", 123); Assert.Equal("The resulting string is: blabla_1234", str); }