Esempio n. 1
0
        public void AddOwningPhrase_ExistingList_AddsToList()
        {
            var part = new ParsedPart(new Word[] { "beans" });
            var q    = new Question();

            q.Text = "Why?";
            part.AddOwningPhrase(q);
            q      = new Question();
            q.Text = "When?";
            part.AddOwningPhrase(q);
            Assert.AreEqual("Why?", part.Owners.First().Text);
            Assert.AreEqual("When?", part.Owners.Skip(1).First().Text);
        }
Esempio n. 2
0
        public void AddOwningPhrase_KeyTermPart_ThrowsInvalidOperationException()
        {
            var part = new ParsedPart(new KeyTermMatchSurrogate("blah snerb", "bleh", "bloh"));

            Assert.AreEqual(PartType.KeyTerm, part.Type);
            Assert.Throws <InvalidOperationException>(() => part.AddOwningPhrase(new Question()));
        }
Esempio n. 3
0
        public void AddOwningPhrase_NullList_CreatesNewList()
        {
            var part = new ParsedPart(new Word[] { "cool", "beans" });

            Assert.AreEqual(PartType.TranslatablePart, part.Type);
            var q = new Question();

            q.Text = "Why?";
            part.AddOwningPhrase(q);
            Assert.AreEqual("Why?", part.Owners.Single().Text);
        }