Пример #1
0
 public void TestIsNEq()
 {
     StrShift hai = new StrShift();
     hai = "Microsoft";
     Assert.AreEqual(false, hai != "Microsoft", "IsNEq is not correct");
     string dummy = hai >> 1;
     dummy = hai >> 2;
     Assert.AreEqual(false, hai != "rosoftMic", "IsNEq is not correct");
 }
Пример #2
0
 public void TestRotateRight()
 {
     StrShift hai = new StrShift();
     hai = "Microsoft";
     Assert.AreEqual("crosoftMi", hai >> 2, "Right Rotate is not correct");
     hai = "haiphan";
     string dummy = hai >> 1;
     dummy = hai >> 1;
     Assert.AreEqual("iphanha", dummy, "Right Rotate is not correct");
 }
Пример #3
0
 public void TestRotateLeft()
 {
     StrShift hai = new StrShift();
     hai = "Microsoft";
     Assert.AreEqual("ftMicroso", hai<<2,"Left Rotate is not correct");
     hai = "haiphan";
     string dummy = hai << 1;
     dummy = hai << 1;
     Assert.AreEqual("anhaiph", dummy, "Left Rotate is not correct");
 }
Пример #4
0
 public void TestAssignment()
 {
     StrShift hai = new StrShift();
     hai = "Microsoft";
     string dummy = hai >> 1;
     dummy = hai << 1;
     Assert.AreEqual("Microsoft", dummy, "Assign is not correct");
     dummy = hai << 3;
     Assert.AreEqual("oftMicros", dummy, "Assign is not correct");
 }
Пример #5
0
 static void Main(string[] args)
 {
     StrShift hai = new StrShift();
     hai = "Microsoft";
     Console.WriteLine("hai>>2 results in "+(hai >> 2));
     StrShift hai_b = new StrShift();
     hai_b = "crosoftMi";
     Console.WriteLine("hai==hai_b:" + (hai == hai_b).ToString());
     Console.WriteLine(hai << 1);
     Console.WriteLine("hai!=hai_b:" + (hai != hai_b).ToString());
     Console.WriteLine(hai << 1);
 }
Пример #6
0
 public bool Equals(StrShift hai)
 {
     return (this == hai);
 }