public void CopyIfBytesChanged_NewDirectory()
        {
            temp = Path.Combine(temp, "foo.bin");

            var foo = new byte [32];

            Assert.IsTrue(MonoAndroidHelper.CopyIfBytesChanged(foo, temp), "Should write on new file.");
            FileAssert.Exists(temp);
        }
        public void CopyIfBytesChanged()
        {
            var foo = new byte [32];

            Assert.IsTrue(MonoAndroidHelper.CopyIfBytesChanged(foo, temp), "Should write on new file.");
            FileAssert.Exists(temp);
            Assert.IsFalse(MonoAndroidHelper.CopyIfBytesChanged(foo, temp), "Should *not* write unless changed.");
            foo [0] = 0xFF;
            Assert.IsTrue(MonoAndroidHelper.CopyIfBytesChanged(foo, temp), "Should write when changed.");
        }
        public void CopyIfBytesChanged_Readonly()
        {
            File.WriteAllText(temp, "");
            File.SetAttributes(temp, FileAttributes.ReadOnly);

            var foo = new byte [32];

            Assert.IsTrue(MonoAndroidHelper.CopyIfBytesChanged(foo, temp), "Should write on new file.");
            FileAssert.Exists(temp);
        }