public static GetXmlEventReadResult ( EventStore.Core.Data.ResolvedEvent evnt, bool dataJson = true, bool metadataJson = true ) : string | ||
evnt | EventStore.Core.Data.ResolvedEvent | |
dataJson | bool | |
metadataJson | bool | |
Résultat | string |
public void should_return_string_data_and_string_metadata_if_both_were_written_as_string_using_xml_events_write() { var request = FakeRequest.GetXmlWrite("data", "metadata"); var events = AutoEventConverter.SmartParse(request, Codec.EventsXml, Guid.Empty); var evnt = events.Single(); var resolvedEvent = GenerateResolvedEvent(evnt.Data, evnt.Metadata); var expected = FakeRequest.GetXmlEventReadResult(resolvedEvent, dataJson: false, metadataJson: false); var converted = AutoEventConverter.SmartFormat(resolvedEvent, Codec.EventXml); Assert.That(converted, Is.EqualTo(expected)); }
public void should_return_xml_data_and_xml_metadata_if_both_were_written_as_jobjects() { var request = FakeRequest.GetJsonWrite(FakeRequest.JsonData, FakeRequest.JsonMetadata); var events = AutoEventConverter.SmartParse(request, Codec.EventsJson, Guid.Empty); var evnt = events.Single(); var resolvedEvent = GenerateResolvedEvent(evnt.Data, evnt.Metadata); var expected = FakeRequest.GetXmlEventReadResult(resolvedEvent, dataJson: true, metadataJson: true); var converted = AutoEventConverter.SmartFormat(resolvedEvent, Codec.EventXml); Assert.That(converted, Is.EqualTo(expected)); }
public void should_return_xml_data_if_data_was_originally_written_as_xobject_and_metadata_as_string() { var request = FakeRequest.GetXmlWrite(FakeRequest.XmlData, "metadata"); var events = AutoEventConverter.SmartParse(request, Codec.EventsXml, Guid.Empty); var evnt = events.Single(); var resolvedEvent = GenerateResolvedEvent(evnt.Data, evnt.Metadata); var expected = FakeRequest.GetXmlEventReadResult(resolvedEvent, dataJson: true, metadataJson: false); var converted = AutoEventConverter.SmartFormat(resolvedEvent, Codec.EventXml); Assert.That(converted, Is.EqualTo(expected)); }
public void should_return_xml_metadata_if_metadata_was_originally_written_as_jobject_and_data_as_string() { var request = FakeRequest.GetJsonWrite("\"data\"", FakeRequest.JsonMetadata); var events = AutoEventConverter.SmartParse(Helper.UTF8NoBom.GetBytes(request), Codec.EventsJson, Guid.Empty); var evnt = events.Single(); var resolvedEvent = GenerateResolvedEvent(evnt.Data, evnt.Metadata); var expected = FakeRequest.GetXmlEventReadResult(resolvedEvent, dataJson: false, metadataJson: true); var converted = AutoEventConverter.SmartFormat(resolvedEvent, Codec.EventXml); Assert.That(converted, Is.EqualTo(expected)); }
should_return_string_data_and_string_metadata_if_both_were_written_as_string_using_json_events_write() { var request = FakeRequest.GetJsonWrite("\"data\"", "\"metadata\""); var events = AutoEventConverter.SmartParse(Helper.UTF8NoBom.GetBytes(request), Codec.EventsJson, Guid.Empty); var evnt = events.Single(); var resolvedEvent = GenerateResolvedEvent(evnt.Data, evnt.Metadata); var expected = FakeRequest.GetXmlEventReadResult(resolvedEvent, dataJson: false, metadataJson: false); var converted = AutoEventConverter.SmartFormat(resolvedEvent, Codec.EventXml); Assert.That(converted, Is.EqualTo(expected)); }