public void CopyIfStringChanged_NewDirectory() { temp = Path.Combine(temp, "foo.txt"); var foo = "bar"; Assert.IsTrue(MonoAndroidHelper.CopyIfStringChanged(foo, temp), "Should write on new file."); FileAssert.Exists(temp); }
public void CopyIfStringChanged() { var foo = "bar"; Assert.IsTrue(MonoAndroidHelper.CopyIfStringChanged(foo, temp), "Should write on new file."); FileAssert.Exists(temp); Assert.IsFalse(MonoAndroidHelper.CopyIfStringChanged(foo, temp), "Should *not* write unless changed."); foo += "\n"; Assert.IsTrue(MonoAndroidHelper.CopyIfStringChanged(foo, temp), "Should write when changed."); }
public void CopyIfStringChanged_Readonly() { File.WriteAllText(temp, ""); File.SetAttributes(temp, FileAttributes.ReadOnly); var foo = "bar"; Assert.IsTrue(MonoAndroidHelper.CopyIfStringChanged(foo, temp), "Should write on new file."); FileAssert.Exists(temp); }