Exemple #1
0
    public void TestOutTypeInterfacePassTry()
    {
        var interfaceClassObj = new TestParamToInterfacePassBaseTwo();
        ITestParamToInterfacePassBaseTwo interfaceType = interfaceClassObj;
        var obj = new TestOutTypeInterfaces();

        obj.FuncTryInterfaceTypeOut(out interfaceType);
        ITestParamToInterfacePassBaseTwo interfaceTypePtr;

        obj.FuncTryInterfaceTypePtrOut(out interfaceTypePtr);
    }
Exemple #2
0
    public void TestParamTypeToInterfacePass()
    {
        var baseClass = new TestParamToInterfacePassBaseTwo();

        baseClass++;
        Assert.AreEqual(baseClass.M, 1);
        ITestParamToInterfacePassBaseTwo baseInterface = new TestParamToInterfacePassBaseTwo();
        var dervClass = new TestParamToInterfacePass();

        dervClass.AddM(baseClass);
        Assert.AreEqual(dervClass.M, 1);
        dervClass = new TestParamToInterfacePass(dervClass + baseClass);
        Assert.AreEqual(dervClass.M, 2);
        dervClass = new TestParamToInterfacePass(dervClass + baseInterface);
        Assert.AreEqual(dervClass.M, 2);
    }
Exemple #3
0
 public void TestOutTypeInterfacePassTry()
 {
     var interfaceClassObj = new TestParamToInterfacePassBaseTwo();
     ITestParamToInterfacePassBaseTwo interfaceType = interfaceClassObj;
     var obj = new TestOutTypeInterfaces();
     obj.FuncTryInterfaceTypeOut(out interfaceType);
     ITestParamToInterfacePassBaseTwo interfaceTypePtr;
     obj.FuncTryInterfaceTypePtrOut(out interfaceTypePtr);
 }
Exemple #4
0
 public void TestParamTypeToInterfacePass()
 {
     var baseClass = new TestParamToInterfacePassBaseTwo();
     baseClass++;
     Assert.AreEqual(baseClass.M, 1);
     ITestParamToInterfacePassBaseTwo baseInterface = new TestParamToInterfacePassBaseTwo();
     var dervClass = new TestParamToInterfacePass();
     dervClass.AddM(baseClass);
     Assert.AreEqual(dervClass.M, 1);
     dervClass = new TestParamToInterfacePass(dervClass + baseClass);
     Assert.AreEqual(dervClass.M, 2);
     dervClass = new TestParamToInterfacePass(dervClass + baseInterface);
     Assert.AreEqual(dervClass.M, 2);
 }