public void Save_File(SettingsType type, string filename) { var dest = Result(filename); type.Save(dest, CreatePerson()); Assert.That(File.Exists(dest), Is.True); }
public void Save_Stream_Throws(SettingsType type, string filename) => Assert.That(() => { using (var sw = new StreamWriter(Result(filename))) { type.Save(sw.BaseStream, CreatePerson()); } }, Throws.TypeOf <ArgumentException>());
public void Save_Stream(SettingsType type, string filename) { var dest = Result(filename); using (var sw = new StreamWriter(dest)) { type.Save(sw.BaseStream, CreatePerson()); } Assert.That(File.Exists(dest), Is.True); }
public void Save_File_Throws(SettingsType type, string filename) => Assert.That( () => type.Save(Result(filename), CreatePerson()), Throws.TypeOf <ArgumentException>() );