コード例 #1
0
 public void OTTagEqualsTest5b()
 {
     OTTag target = new OTTag(new byte[4] { 1, 3, 5, 7 });
     uint tagValue = 0x01030509;
     bool expected = false;
     bool actual;
     actual = target.Equals(tagValue);
     Assert.AreEqual(expected, actual, "OTTag not as expected: hash = " + target.GetHashCode());
 }
コード例 #2
0
 public void OTTagGetHashCodeTest()
 {
     OTTag target = new OTTag(new byte[4] { 0xff, 0xfe, 0xfd, 0xfc });
     // Object.GetHashCode returns int (signed). Can't cast 0xFF00_0000 directly to int.
     int expected = 0xfefdfc + (int)(0xff << 24);
     int actual;
     actual = target.GetHashCode();
     Assert.AreEqual(expected, actual, "Error: unexpected result from OTTag.GetHashCode()");
 }
コード例 #3
0
 public void OTTagConstructorTest6a()
 {
     string tag = "abcd";
     OTTag target = new OTTag(tag);
     Assert.IsTrue(ArraysMatch(new byte[4] { 97, 98, 99, 100 }, target.GetBytes()), "OTTag not as expected: hash = " + target.GetHashCode());
 }
コード例 #4
0
 public void OTTagConstructorTest2c()
 {
     byte[] tagBuffer = new byte[3] { 1, 3, 5 };
     OTTag target = new OTTag(tagBuffer);
     Assert.IsTrue(ArraysMatch(new byte[4] { 1, 3, 5, 0 }, target.GetBytes()), "OTTag not as expected: hash = " + target.GetHashCode());
 }
コード例 #5
0
 public void OTTagOperator_EqualityTest1c()
 {
     OTTag lhs = new OTTag(new byte[4] { 1, 3, 5, 7 });
     OTTag rhs = null;
     bool expected = false;
     bool actual;
     actual = (lhs == rhs);
     Assert.AreEqual(expected, actual, "Unexpected result from OTTag == OTTag; hash = " + lhs.GetHashCode());
 }
コード例 #6
0
 public void OTTagEqualsTest4e()
 {
     OTTag target = new OTTag(new byte[4] { 97, 98, 99, 100 });
     string tag = null;
     bool expected = false;
     bool actual;
     actual = target.Equals(tag);
     Assert.AreEqual(expected, actual, "Unexpected result from OTTag.Equals(OTTag); hash = " + target.GetHashCode());
 }
コード例 #7
0
 public void OTTagConstructorTest1()
 {
     OTTag target = new OTTag();
     Assert.IsTrue(ArraysMatch(new byte[4] { 0, 0, 0, 0 }, target.GetBytes()), "OTTag not as expected: hash = " + target.GetHashCode());
 }
コード例 #8
0
 public void OTTagEqualsTest3b()
 {
     OTTag target = new OTTag(new byte[4] { 1, 3, 5, 7 });
     OTTag tag = new OTTag(new byte[4] { 1, 3, 5, 9 });
     bool expected = false;
     bool actual;
     actual = target.Equals(tag);
     Assert.AreEqual(expected, actual, "Unexpected result from OTTag.Equals(OTTag); hash = " + target.GetHashCode());
 }
コード例 #9
0
 public void OTTagEqualsTest2e()
 {
     OTTag target = new OTTag(new byte[4] { 1, 3, 5, 7 });
     byte[] tagBuffer = new byte[5] { 1, 3, 5, 7, 9 };
     bool expected = false;
     bool actual;
     actual = target.Equals(tagBuffer);
     Assert.AreEqual(expected, actual, "Unexpected result from OTTag.Equals(byte[]); hash = " + target.GetHashCode());
 }
コード例 #10
0
 public void OTTagEqualsTest1d()
 {
     OTTag target = new OTTag(new byte[4] { 1, 3, 5, 7 });
     object obj = new object();
     bool expected = false;
     bool actual;
     actual = target.Equals(obj);
     Assert.AreEqual(expected, actual, "Unexpected result from OTTag.Equals(object); hash = " + target.GetHashCode());
 }
コード例 #11
0
 public void OTTagConstructorTest7()
 {
     uint tagValue = 0x11223344;
     OTTag target = new OTTag(tagValue);
     Assert.IsTrue(ArraysMatch(new byte[4] { 0x11, 0x22, 0x33, 0x44 }, target.GetBytes()), "OTTag not as expected: hash = " + target.GetHashCode());
 }