コード例 #1
0
        public void CopyTo1()
        {
            StateArray sourceStateArray = new StateArray(64);

            sourceStateArray[0]  = true;
            sourceStateArray[1]  = true;
            sourceStateArray[8]  = true;
            sourceStateArray[32] = true;
            sourceStateArray[33] = true;
            sourceStateArray[62] = true;
            sourceStateArray[63] = true;
            StateArray destinationStateArray = new StateArray(64);

            sourceStateArray.CopyTo(destinationStateArray);
            for (int i = 0; i < 64; i++)
            {
                if (i == 0 || i == 1 || i == 8 || i == 32 || i == 33 || i == 62 || i == 63)
                {
                    Assert.IsTrue(destinationStateArray[i]);
                }
                else
                {
                    Assert.IsFalse(destinationStateArray[i]);
                }
            }
        }
コード例 #2
0
 public void CopyTo2()
 {
     for (int i = 0; i < 160; i++)
     {
         StateArray sourceStateArray = new StateArray(160);
         sourceStateArray[i] = true;
         StateArray destinationStateArray = new StateArray(160);
         sourceStateArray.CopyTo(destinationStateArray);
         for (int k = 0; k < 160; k++)
         {
             if (k == i)
             {
                 Assert.IsTrue(destinationStateArray[k]);
             }
             else
             {
                 Assert.IsFalse(destinationStateArray[k]);
             }
         }
     }
 }