예제 #1
0
        public void GetSegments_TaggedText_SameAsSource()
        {
            var segments = Parser.ParseFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TaggedFile.txt"));

            var file = new File
            {
                SourceCulture = CultureInfo.GetCultureInfo("en-us"),
                TargetCulture = CultureInfo.GetCultureInfo("fr")
            };

            var xliff = new Xliff
            {
                File = file
            };


            foreach (var segment in segments)
            {
                xliff.AddTranslation(segment, segment, "MTEdge");
            }

            var targetSegments = xliff.GetTargetSegments();

            for (int i = 0; i < segments.Length; i++)
            {
                Assert.AreEqual(segments[i].ToString(), targetSegments[i].ToString());
            }
        }
예제 #2
0
        public void AddTranslation_NullSourceSegment_ThrowsException()
        {
            var file = new File
            {
                SourceCulture = CultureInfo.GetCultureInfo("en-us"),
                TargetCulture = CultureInfo.GetCultureInfo("fr")
            };

            var xliff = new Xliff
            {
                File = file
            };

            xliff.AddTranslation(null, new Segment(xliff.File.SourceCulture), "MTEdge");
        }
예제 #3
0
        public void AddTranslation_NullSourceSegment_ThrowsException()
        {
            var xliff = new Xliff(CultureInfo.GetCultureInfo("en-us"), CultureInfo.GetCultureInfo("fr"));

            xliff.AddTranslation(null, new Segment(xliff.File.SourceCulture), "MTEdge");
        }
예제 #4
0
        public void AddTranslation_NullTargetSegment_ThrowsException()
        {
            var xliff = new Xliff(CultureInfo.GetCultureInfo("en-us"), CultureInfo.GetCultureInfo("fr"));

            xliff.AddTranslation(new Segment(xliff.File.SourceCulture), null, "ETS");
        }