Ejemplo n.º 1
0
        public void TestSortingSingle()
        {
            sorter.SortByField = "Title";
            SourceSorter.FilterSources(sorter);

            Assert.ReferenceEquals(source3, sorter.GetSources(""));
        }
        private void CreateSources()
        {
            CitationFormat format  = GlobalResources.GetFormat("Print");
            Source         source1 = new Source(format),
                           source2 = new Source(format),
                           source3 = new Source(format);

            source1.GetField("title").SetValues("The Lion, the Witch, and the Wardrobe");
            source1.GetField("author").SetValues("C.S. Lewis");
            source2.GetField("title").SetValues("The Lord of the Rings: the Fellowship of the Ring");
            source2.GetField("author").SetValues("J.R.R. Tolkien");
            source3.GetField("title").SetValues("To Kill a Mockingbird");
            source3.GetField("author").SetValues("Harper Lee");

            GlobalResources.OpenLibrary.AddSource(source1);
            GlobalResources.OpenLibrary.AddSource(source2);
            GlobalResources.OpenLibrary.AddSource(source3);

            _sourceSorter.FilterSources();
        }