コード例 #1
0
        public void TestEquals2()
        {
            MyUIntBase temp1 = new MyUIntBase();
            object     temp2 = null;
            object     temp3 = new object();

            Assert.AreEqual(false, temp1.Equals(temp2));
            Assert.AreEqual(false, temp1.Equals(temp3));
        }
コード例 #2
0
        public void TestEquals1()
        {
            MyUIntBase temp1 = new MyUIntBase();
            MyUIntBase temp2 = new MyUIntBase();
            UInt160    temp3 = new UInt160();

            Assert.AreEqual(false, temp1.Equals(null));
            Assert.AreEqual(true, temp1.Equals(temp1));
            Assert.AreEqual(true, temp1.Equals(temp2));
            Assert.AreEqual(false, temp1.Equals(temp3));
        }
コード例 #3
0
 public void TestDeserialize()
 {
     using (MemoryStream stream = new MemoryStream())
         using (BinaryWriter writer = new BinaryWriter(stream))
             using (BinaryReader reader = new BinaryReader(stream))
             {
                 writer.Write(new byte[20]);
                 stream.Seek(0, SeekOrigin.Begin);
                 MyUIntBase uIntBase = new MyUIntBase();
                 Action     action   = () => ((ISerializable)uIntBase).Deserialize(reader);
                 action.Should().Throw <FormatException>();
             }
 }