Ejemplo n.º 1
0
        public void It_should_set_all_elements_in_array_to_zero()
        {
            var source = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

            SecurityExtensions.Clear(source);
            CollectionAssert.AreEqual(new byte[10], source);
        }
Ejemplo n.º 2
0
        public void It_should_set_all_elements_in_buffer_to_zero()
        {
            var source = CryptographicBuffer.CreateFromByteArray(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 });

            SecurityExtensions.Clear(source);
            var expected = CryptographicBuffer.CreateFromByteArray(new byte[10]);

            Assert.IsTrue(CryptographicBuffer.Compare(expected, source), "source buffer does not compare equal to a buffer containing only 0's");
        }
Ejemplo n.º 3
0
 public void It_should_not_throw_if_source_buffer_is_empty()
 {
     SecurityExtensions.Clear(new Windows.Storage.Streams.Buffer(0));
 }
Ejemplo n.º 4
0
 public void It_should_not_throw_if_source_buffer_is_null()
 {
     SecurityExtensions.Clear((IBuffer)null);
 }
Ejemplo n.º 5
0
 public void It_should_not_throw_if_source_is_empty()
 {
     SecurityExtensions.Clear(new byte[0]);
 }
Ejemplo n.º 6
0
 public void It_should_not_throw_if_source_is_null()
 {
     SecurityExtensions.Clear((byte[])null);
 }