コード例 #1
0
        public static void Test_Wrong()
        {
            PointStruct p = new PointStruct(5, 10);

            Contract.Assert(p.X == 5);

            Contract.Assert(p.SquareDistance == 125);

            p.Move(2);

            Contract.Assert(p.X == 5);  // False
            Contract.Assert(p.Y == 11); // Unreached
        }
コード例 #2
0
        public static void Test_OK()
        {
            PointStruct p = new PointStruct(5, 10);

            Contract.Assert(p.X == 5);

            Contract.Assert(p.SquareDistance == 125);

            p.Move(2);

            Contract.Assert(p.X == 7);
            Contract.Assert(p.Y == 12);
        }
コード例 #3
0
    public static void Test_Wrong()
    {
      PointStruct p = new PointStruct(5, 10);
      Contract.Assert(p.X == 5);

      Contract.Assert(p.SquareDistance == 125);

      p.Move(2);

      Contract.Assert(p.X == 5); // False
      Contract.Assert(p.Y == 11); // Unreached
    }
コード例 #4
0
    public static void Test_OK()
    {
      PointStruct p = new PointStruct(5, 10);
      Contract.Assert(p.X == 5);

      Contract.Assert(p.SquareDistance == 125);

      p.Move(2);

      Contract.Assert(p.X == 7);
      Contract.Assert(p.Y == 12);
    }