public void ConflictNotificationSerialization() { var metadata = new RavenJObject { { Constants.LastModified, "2014-07-07T12:00:00.0000000" }, { Constants.FileSystem.RavenFsSize, "128" } }; var fileHeader = new FileHeader("test1.file", metadata); var notification = new ConflictNotification() { FileName = "test1.file", SourceServerUrl = "http://destination", RemoteFileHeader = fileHeader, Status = ConflictStatus.Detected}; var serializedValue = JsonExtensions.ToJObject(notification); var jr = new RavenJTokenReader(serializedValue); var deserializedValue = JsonExtensions.CreateDefaultJsonSerializer().Deserialize<ConflictNotification>(jr); Assert.NotNull(deserializedValue); }
internal void OnFileConflict(ConflictNotification notification) { if ( notification.Status == ConflictStatus.Detected) { conflicts.Add(notification.FileName); } else { entitiesByKey.Remove(notification.FileName); conflicts.Remove(notification.FileName); } }
public void Send(ConflictNotification conflictsNotification) { var onConflictNotification = OnConflictsNotification; if (onConflictNotification != null) onConflictNotification(conflictsNotification); }