예제 #1
0
        public void ReadingTestMxd_SingleFolderRecursiv_Runs()
        {
            var s = GetMapDocumentConfigItemsForSingleFolderRecursiv();
            var sut = new MxdContentFinder(s);
            sut.FoundContent += FoundContent;
            sut.FinishedSearch += FinishedSearch;

            sut.StartSearch();
            while (!_finished)
            {
            }

            Assert.That(_mxdContents.Count, Is.EqualTo(7));

            IEnumerable<string> topTexts = _mxdContents.Select(_ => _.Title);
            Assert.True(topTexts.Contains("Title of MapDocument1"));
            Assert.True(topTexts.Contains("Title of MapDocumentA1"));
            Assert.True(topTexts.Contains("Title of MapDocumentAA1"));
            Assert.True(topTexts.Contains("Title of MapDocumentAA2"));
            Assert.True(topTexts.Contains("Title of MapDocumentAB1"));
            Assert.True(topTexts.Contains("Title of MapDocumentAB2"));
            Assert.True(topTexts.Contains("Title of MapDocumentB1"));

            IEnumerable<string> bottomTexts = _mxdContents.Select(_ => _.Subject);
            Assert.True(bottomTexts.Contains("Summary of MapDocument1"));
            Assert.True(bottomTexts.Contains("Summary of MapDocumentA1"));
            Assert.True(bottomTexts.Contains("Summary of MapDocumentAA1"));
            Assert.True(bottomTexts.Contains("Summary of MapDocumentAA2"));
            Assert.True(bottomTexts.Contains("Summary of MapDocumentAB1"));
            Assert.True(bottomTexts.Contains("Summary of MapDocumentAB2"));
            Assert.True(bottomTexts.Contains("Summary of MapDocumentB1"));

            IEnumerable<string> tooltipTexts = _mxdContents.Select(_ => _.Comments);
            Assert.True(tooltipTexts.Contains("Description of MapDocument1"));
            Assert.True(tooltipTexts.Contains("Description of MapDocumentA1"));
            Assert.True(tooltipTexts.Contains("Description of MapDocumentAA1"));
            Assert.True(tooltipTexts.Contains("Description of MapDocumentAA2"));
            Assert.True(tooltipTexts.Contains("Description of MapDocumentAB1"));
            Assert.True(tooltipTexts.Contains("Description of MapDocumentAB2"));
            Assert.True(tooltipTexts.Contains("Description of MapDocumentB1"));

            foreach (MxdContent mxdContent in _mxdContents)
            {
                Assert.That(mxdContent.Bitmap.Size.Width, Is.GreaterThan(0));
                Assert.That(mxdContent.Bitmap.Size.Height, Is.GreaterThan(0));
            }
        }
예제 #2
0
        public void ReadingTestMxd_SingleFolderNonRecursiv_Runs()
        {
            var s = GetMapDocumentConfigItemsForSingleFolderNonRecursiv();
            var sut = new MxdContentFinder(s);
            sut.FoundContent += FoundContent;
            sut.FinishedSearch += FinishedSearch;

            sut.StartSearch();
            while (!_finished)
            {
            }

            Assert.That(_counter, Is.EqualTo(1));

            Assert.That(_content, !Is.Null);
            Assert.That(_content.Title, Is.EqualTo("Title of MapDocument1"));
            Assert.That(_content.Bitmap, !Is.Null);

            var mxdContent = (MxdContent) _content;

            Assert.That(mxdContent.Subject, Is.EqualTo("Summary of MapDocument1"));
            Assert.That(mxdContent.Comments, Is.EqualTo("Description of MapDocument1"));
        }