public void RoundtripRepositorySettingsWithNullBackupSettings() { var settings = new DataRepositorySettings( directory: Directory.FullName, isTrackingDirty: true, saveNullDeletesFile: true, backupSettings: null, extension: ".cde", tempExtension: ".fgh"); var sb = new StringBuilder(); var serializer = new XmlSerializer(settings.GetType()); using (var writer = new StringWriter(sb)) { serializer.Serialize(writer, settings); } var xml = sb.ToString(); ////Console.Write(xml); using (var reader = new StringReader(xml)) { var roundtripped = (DataRepositorySettings)serializer.Deserialize(reader); AssertProperties(settings, roundtripped); } }
public void RoundtripRepositorySettingsWithRepository() { var settings = new DataRepositorySettings( directory: Directory.FullName, isTrackingDirty: true, saveNullDeletesFile: true, backupSettings: BackupSettings, extension: ".cde", tempExtension: ".fgh"); var repository = new DataRepository(DataRepositorySettings); repository.Save(settings); var roundtripped = repository.Read <DataRepositorySettings>(); AssertProperties(settings, roundtripped); }