protected override ITransUnit CreateTransUnit(string id, bool dynamic, ITransUnitVariant sourceVariant, ITransUnitVariant targetVariant = null, string noteText = null, TranslationStatus?translationStatus = null, bool?noLongerUsed = null) { var tu = new XLiffTransUnit { Id = id, Source = (XLiffTransUnitVariant)sourceVariant, Target = (XLiffTransUnitVariant)targetVariant }; if (dynamic) { tu.Dynamic = true; } if (!string.IsNullOrEmpty(noteText)) { tu.Notes = new List <XLiffNote> { new XLiffNote { Text = noteText } } } ; if (translationStatus.HasValue) { tu.TranslationStatus = translationStatus.Value; } return(tu); }
private void CheckMergedTransUnit(XLiffTransUnit tu, string sourceText, string[] notes, bool isDynamic) { Assert.IsNotNull(tu); Assert.That("en", Is.EqualTo(tu.Source.Lang)); Assert.That(sourceText, Is.EqualTo(tu.Source.Value)); Assert.That(notes.Length, Is.EqualTo(tu.Notes.Count)); for (int i = 0; i < notes.Length; ++i) { Assert.That(notes[i], Is.EqualTo(tu.Notes[i].Text)); } Assert.That(isDynamic, Is.EqualTo(tu.Dynamic)); }