Exemple #1
0
        public void FindAliasesFromNames(string path2NamesFile)
        {
            AliasFinder af = new AliasFinder();

            af.InitializeMappingFromNames(File.ReadAllLines(path2NamesFile));
            FindAliases(af);
        }
Exemple #2
0
        public void TestSimpleAliasingWithNames()
        {
            AliasFinder af = new AliasFinder();

            af.InitializeMappingFromNames(nameMappingTest.Split('\n'));

            string[] names = af.Consolidate(authorTestset.Split('\n'))
                             .Select(reviewerList => string.Join(",", reviewerList)) // put each reviewer in one string
                             .OrderBy(x => x)                                        // sort the resulting reviewers
                             .ToArray();

            Assert.AreEqual(4, names.Length);
            Assert.AreEqual("Completely different", names[0]);
            Assert.AreEqual("Completely different van mail address [:cdma] <unmapped@address>", names[1]);
        }
Exemple #3
0
        public void TestMappingMatch()
        {
            AliasFinder afNames = new AliasFinder();

            afNames.InitializeMappingFromNames(nameMappingTest.Split('\n'));

            AliasFinder afAuthors = new AliasFinder();

            afAuthors.InitializeMappingFromAuthorList(authorMultiList.Split('\n'));

            string[] namesFromNames = afNames.Consolidate(authorTestset.Split('\n'))
                                      .Select(reviewerList => string.Join(",", reviewerList)) // put each reviewer in one string
                                      .OrderBy(x => x)                                        // sort the resulting reviewers
                                      .ToArray();

            string[] namesFromAuthors = afAuthors.Consolidate(authorTestset.Split('\n'))
                                        .Select(reviewerList => string.Join(",", reviewerList)) // put each reviewer in one string
                                        .OrderBy(x => x)                                        // sort the resulting reviewers
                                        .ToArray();

            CollectionAssert.AreEquivalent(namesFromAuthors, namesFromNames);
        }