Beispiel #1
0
        public void XliffWriter_MarkedSpanStart()
        {
            MarkedSpanStart span;
            Segment         segment;
            Unit            unit;
            string          actualValue;

            unit = new Unit("u1");
            this._document.SourceLanguage = "en-us";
            this._document.Files.Add(new File("f1"));
            this._document.Files[0].Containers.Add(unit);

            segment = new Segment("s1");
            unit.Resources.Add(segment);
            segment.Source = new Source();
            span           = new MarkedSpanStart("mrk1");
            segment.Source.Text.Add(span);

            actualValue = this.Serialize();
            // Translate value will be automatically written because type is generic (default).
            Assert.AreEqual(TestUtilities.GetFileContents(TestData.MarkedSpanStartWithValidValues), actualValue);

            span.Type   = MarkedSpanTypes.Term;
            actualValue = this.Serialize();
            Assert.AreEqual(TestUtilities.GetFileContents(TestData.MarkedSpanStartWithTerm), actualValue);

            span.Type   = "my:type";
            actualValue = this.Serialize();
            Assert.AreEqual(TestUtilities.GetFileContents(TestData.MarkedSpanStartWithCustomType), actualValue);
        }
 public void TestInitialize()
 {
     this._element  = new MarkedSpanStart();
     this._provider = this._element;
 }
 public void TestInitialize()
 {
     this._element = new MarkedSpanStart();
     this._provider = this._element;
 }