public void StringifyingAComponentContainingASpecificSeparator() { var component = new EdiComponent("a>b"); var options = new EdiOptions { ComponentSeparator = '>' }; Assert.AreEqual("a>b", component.ToString(options)); }
public void ConvertingAnElementToAStringWithSpecificSeparators() { var element = new EdiElement(); element.Repetitions.Add(new EdiRepetition("1234")); element.Repetitions.Add(new EdiRepetition("5678")); var options = new EdiOptions {RepetitionSeparator = '^'}; Assert.AreEqual("1234^5678", element.ToString(options)); }
public void ConvertingARepetitionToAStringWithSpecificSeparators() { var repetition = new EdiRepetition(); repetition[02] = "1234"; repetition[04] = "5678"; var options = new EdiOptions {ComponentSeparator = '<'}; Assert.AreEqual("<1234<<5678", repetition.ToString(options)); }
public void ConvertingASegmentToAStringWithSpecificSeparators() { var segment = new EdiSegment("SEG"); segment[02] = "1234"; segment[04] = "5678"; var options = new EdiOptions {SegmentTerminator = '~'}; Assert.AreEqual("SEG**1234**5678~", segment.ToString(options)); }
/// <summary> /// Initializes a new instance of the EdiOptions class with values copied from the specified EdiOptions parameter. /// </summary> /// <param name="source">An EdiOptions containing values to copy.</param> public EdiOptions(EdiOptions source) { SegmentTerminator = source.SegmentTerminator; ElementSeparator = source.ElementSeparator; ComponentSeparator = source.ComponentSeparator; RepetitionSeparator = source.RepetitionSeparator; DecimalIndicator = source.DecimalIndicator; ReleaseCharacter = source.ReleaseCharacter; AddLineBreaks = source.AddLineBreaks; }
public void StringifyingAComponentContainerSeparatorsWithAReleaseCharacter() { var component = new EdiComponent(":+.? '"); var options = new EdiOptions { ComponentSeparator = ':', ElementSeparator = '+', ReleaseCharacter = '?', SegmentTerminator = '\'' }; Assert.AreEqual("?:?+.?? ?'", component.ToString(options)); }
public void ConvertingAnElementToAStringWithSpecificSeparators() { var element = new EdiElement(); element.Repetitions.Add(new EdiRepetition("1234")); element.Repetitions.Add(new EdiRepetition("5678")); var options = new EdiOptions { RepetitionSeparator = '^' }; Assert.AreEqual("1234^5678", element.ToString(options)); }
public void ConvertingARepetitionToAStringWithSpecificSeparators() { var repetition = new EdiRepetition(); repetition[02] = "1234"; repetition[04] = "5678"; var options = new EdiOptions { ComponentSeparator = '<' }; Assert.AreEqual("<1234<<5678", repetition.ToString(options)); }
public void ConvertingASegmentToAStringWithSpecificSeparators() { var segment = new EdiSegment("SEG"); segment[02] = "1234"; segment[04] = "5678"; var options = new EdiOptions { SegmentTerminator = '~' }; Assert.AreEqual("SEG**1234**5678~", segment.ToString(options)); }
public void ConvertingAUnaSegmentToAString() { var segment = new EdiSegment("UNA"); var options = new EdiOptions { ComponentSeparator = ':', ElementSeparator = '+', ReleaseCharacter = '?', SegmentTerminator = '\'' }; Assert.AreEqual("UNA:+.? '", segment.ToString(options)); }
public void SavingAValueContainingASeparator() { var options = new EdiOptions { SegmentTerminator = '~', ElementSeparator = '*' }; var document = new EdiDocument(options); var segment = new EdiSegment("SEG"); segment[01] = document.Options.ElementSeparator.ToString(); document.Segments.Add(segment); var buffer = new StringWriter(); document.Save(buffer); }
public void ReadingASegment() { var options = new EdiOptions { ElementSeparator = '*', SegmentTerminator = '~' }; EdiDocument document = EdiDocument.Parse("ST*997*0001~", options); Assert.AreEqual(1, document.Segments.Count); Assert.AreEqual("ST", document.Segments[0].Id); Assert.AreEqual(2, document.Segments[0].Elements.Count); Assert.AreEqual("997", document.Segments[0].Elements[0].Value); Assert.AreEqual("0001", document.Segments[0].Elements[1].Value); }
public void SavingAValueContainingASeparator() { var options = new EdiOptions {SegmentTerminator = '~', ElementSeparator = '*'}; var document = new EdiDocument(options); var segment = new EdiSegment("SEG"); segment[01] = document.Options.ElementSeparator.ToString(); document.Segments.Add(segment); var buffer = new StringWriter(); document.Save(buffer); }
public void StringifyingAComponentContainingASpecificSeparator() { var component = new EdiComponent("a>b"); var options = new EdiOptions {ComponentSeparator = '>'}; Assert.AreEqual("a>b", component.ToString(options)); }