Why does Assert.AreEqual(T obj1, Tobj2) fail with identical byte arrays

前端 未结 6 2094
日久生厌
日久生厌 2021-02-03 16:56

I have two identical byte arrays in the following segment of code:

    /// 
    ///A test for Bytes
    ///
    [TestMethod()]
            


        
6条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-03 17:05

    //Initialize your arrays here
    byte[] array1 = new byte[0];
    byte[] array2 = new byte[0];
    
    Assert.AreEqual(System.Convert.ToBase64String(array1),
                    System.Convert.ToBase64String(array2));
    

提交回复
热议问题