예제 #1
0
        public void TestSaltCopy()
        {
            Salt s = new Salt();

            byte[] bytes = new byte[s.Length];
            s.CopyTo(bytes, 0);
            Assert.AreEqual(s.ToArray(), bytes);
            Assert.AreEqual(s.GetHashCode(), Salt.FromBytes(bytes).GetHashCode());

            Salt strcpy = Salt.FromString(s.ToString());

            Assert.AreEqual(s.ToArray(), strcpy.ToArray());
            Assert.AreEqual(s.ToString(), strcpy.ToString());
            Assert.AreEqual(s.GetHashCode(), strcpy.GetHashCode());
        }