Ejemplo n.º 1
0
      public static void InheritanceTest07()
      {
          TestClass2 cls = new TestCls5();

          cls.VMethod1();
          int val = 0;

          cls.VMethod3(ref val);
          if (val != 11)
          {
              throw new Exception($"{val} != 11");
          }
          float val2 = cls.AbMethod2(val);

          if (val2 != 12.2f)
          {
              throw new Exception($"{val2} != 12.1f");
          }

          cls = new TestCls6();
          val = 0;
          cls.VMethod3(ref val);
          if (val != 21)
          {
              throw new Exception($"{val} != 21");
          }
          val2 = cls.AbMethod2(val);
          if (val2 != 24.2f)
          {
              throw new Exception($"{val2} != 23.2f");
          }
      }
Ejemplo n.º 2
0
      public static void InheritanceTest07()
      {
          TestClass2 cls = new TestCls5();

          Console.WriteLine(cls.VMethod2());
          Console.WriteLine(cls.AbMethod2(122));
          int val = 0;

          cls.VMethod3(ref val);
          if (val != 11)
          {
              throw new Exception();
          }
          Console.WriteLine(val);
      }
Ejemplo n.º 3
0
      public static void InheritanceTest07()
      {
          TestClass2 cls = new TestCls5();

          Console.WriteLine(cls.AbMethod2(122));
      }