Beispiel #1
0
 public string Load_Stream(SettingsType type, string filename)
 {
     using (var reader = new StreamReader(Example(filename)))
     {
         return(type.Load <Person>(reader.BaseStream).Name);
     }
 }
Beispiel #2
0
 public void Load_Stream_Throws(SettingsType type, string filename)
 => Assert.That(() =>
 {
     using (var reader = new StreamReader(Example(filename)))
     {
         type.Load <Person>(reader.BaseStream);
     }
 }, Throws.TypeOf <ArgumentException>());
Beispiel #3
0
 public void Load_File_Throws(SettingsType type, string filename)
 => Assert.That(
     () => type.Load <Person>(Example(filename)),
     Throws.TypeOf <ArgumentException>()
     );
Beispiel #4
0
 public string Load_File(SettingsType type, string filename)
 => type.Load <Person>(Example(filename)).Name;