Exemple #1
0
        public void Save_File(SettingsType type, string filename)
        {
            var dest = Result(filename);

            type.Save(dest, CreatePerson());
            Assert.That(File.Exists(dest), Is.True);
        }
Exemple #2
0
 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>());
Exemple #3
0
        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);
        }
Exemple #4
0
 public void Save_File_Throws(SettingsType type, string filename)
 => Assert.That(
     () => type.Save(Result(filename), CreatePerson()),
     Throws.TypeOf <ArgumentException>()
     );