Exemplo n.º 1
0
        public void TestRoundTrip_FileNames()
        {
            var a1 = new WordNode("DB", PartOfSpeechTag.Preamble);
            var a2 = new WordNode("Get", PartOfSpeechTag.Verb);
            var t1 = new WordNode("Hydro", PartOfSpeechTag.NounModifier);
            var t2 = new WordNode("Fixed", PartOfSpeechTag.NounModifier);
            var t3 = new WordNode("Schedule", PartOfSpeechTag.Noun);
            var f1 = @"C:\foo\bar.cpp";
            var f2 = @"C:\foo\baz\xyzzy.h";
            var f3 = "test.cpp";

            var sdr = new SwumDataRecord();

            sdr.ParsedAction = new PhraseNode(new[] { a1, a2 }, Location.None, false);
            sdr.Action       = sdr.ParsedAction.ToPlainString();
            sdr.ParsedTheme  = new PhraseNode(new[] { t1, t2, t3 }, Location.None, false);
            sdr.Theme        = sdr.ParsedTheme.ToPlainString();
            sdr.FileNames.Add(f1);
            sdr.FileNames.Add(f2);
            sdr.FileNames.Add(f3);

            var actual = SwumDataRecord.Parse(sdr.ToString());

            Assert.IsTrue(SwumDataRecordsAreEqual(sdr, actual));
        }
Exemplo n.º 2
0
        public void TestRoundTrip()
        {
            var a1 = new WordNode("DB", PartOfSpeechTag.Preamble);
            var a2 = new WordNode("Get", PartOfSpeechTag.Verb);
            var t1 = new WordNode("Hydro", PartOfSpeechTag.NounModifier);
            var t2 = new WordNode("Fixed", PartOfSpeechTag.NounModifier);
            var t3 = new WordNode("Schedule", PartOfSpeechTag.Noun);

            var sdr = new SwumDataRecord();

            sdr.ParsedAction = new PhraseNode(new[] { a1, a2 }, Location.None, false);
            sdr.Action       = sdr.ParsedAction.ToPlainString();
            sdr.ParsedTheme  = new PhraseNode(new[] { t1, t2, t3 }, Location.None, false);
            sdr.Theme        = sdr.ParsedTheme.ToPlainString();

            var actual = SwumDataRecord.Parse(sdr.ToString());

            Assert.IsTrue(SwumDataRecordsAreEqual(sdr, actual));
        }