public void GetSegments_TaggedText_SameAsSource() { Segment[] segments = SegmentParser.Parser.ParseFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TaggedFile.txt")); XliffConverter.xliff xliff = new XliffConverter.xliff( CultureInfo.GetCultureInfo("en-us"), CultureInfo.GetCultureInfo("fr")); foreach (Segment segment in segments) { xliff.AddTranslation(segment, segment, "ETS"); } Segment[] targetSegments = xliff.GetTargetSegments(); for (int i = 0; i < segments.Length; i++) { Assert.AreEqual(segments[i].ToString(), targetSegments[i].ToString()); } }
public void AddTranslation_NullTargetSegment_ThrowsException() { XliffConverter.xliff xliff = new XliffConverter.xliff( CultureInfo.GetCultureInfo("en-us"), CultureInfo.GetCultureInfo("fr")); xliff.AddTranslation(new Segment(xliff.File.SourceCulture), null, "ETS"); }