6
为什么Assert.AreEqual(T obj1,Tobj2)在相同的字节数组下失败
在以下代码段中,我有两个相同的字节数组: /// <summary> ///A test for Bytes ///</summary> [TestMethod()] public void BytesTest() { byte[] bytes = Encoding.UTF8.GetBytes(Properties.Resources.ExpectedPacketData); TransferEventArgs target = new TransferEventArgs(bytes); byte[] expected = Encoding.UTF8.GetBytes(Properties.Resources.ExpectedPacketValue); byte[] actual; actual = target.Bytes; Assert.AreEqual(expected, actual); } 直到下一个字节,两个数组都是相同的。在这种情况下,为什么Assert.AreEqual失败?
86
c#
unit-testing
assert