コード例 #1
0
        internal virtual ITaggedTextSource CreateITaggedTextSource()
        {
            // TODO: Instantiate an appropriate concrete class.
            ITaggedTextSource target = new TaggedTextFragment(Tagger.TaggedFromRaw(new[] {
                "John enjoyed, with his usual lack of humility, consuming the object in question.",
                "Some may call him a heathen, but they are mistaken.",
                "Heathens are far less dangerous than he."
            }),
                                                              "test fragment");

            return(target);
        }
コード例 #2
0
        public void TaggedTextFragmentConstructorTest()
        {
            var lines = Tagger.TaggedFromRaw(new[] {
                "This is a test which i will not regret.",
                "While it may yield me, in the context of the system at large, only ",
                "a little confidence, each test makes everything else that much better."
            });
            var name   = "Test Fragment";
            var target = new TaggedTextFragment(lines, name);

            Check.That(target.Name).IsEqualTo(name);
        }
コード例 #3
0
        public async Task LoadTextAsyncTest()
        {
            var lines = Tagger.TaggedFromRaw(new[] {
                "This is a test which i will not regret.",
                "While it may yield me, in the context of the system at large, only ",
                "a little confidence, each test makes everything else that much better."
            });
            var name     = "Test Fragment";
            var target   = new TaggedTextFragment(lines, name);
            var expected = string.Join("\n", lines);
            var actual   = await target.LoadTextAsync();

            Check.That(actual).IsEqualTo(expected);
        }