コード例 #1
0
        public void TestNotFirstStep()
        {
            var people = new Person[] { new Person(0, 1, 2) };
            var old = new CandiateRanking[][] { };

            var s = new ESKeepThoseBetterThan(0.5);
            s.RunStep(people, old);
        }
コード例 #2
0
        public void TestSimpleRunNoOneFailWhen()
        {
            var people = new Person[] {
                new Person(0, 1, 2),
                new Person(0, 1, 2),
                new Person(0, 1, 2),
                new Person(0, 1, 2),
            };
            var old = new CandiateRanking[][] { new CandiateRanking[] { new CandiateRanking(0, 2), new CandiateRanking(1, 2) } };

            var s = new ESKeepThoseBetterThan(0.7) { DoNothingIfNoOnePasses=false };
            var r = s.RunStep(people, old);
            Assert.AreEqual(0, r.Length, "# of candidates ranked");
        }
コード例 #3
0
        public void TestSimpleRun()
        {
            var people = new Person[] {
                new Person(0, 1, 2),
                new Person(0, 1, 2),
                new Person(0, 1, 2),
                new Person(0, 1, 2),
            };
            var old = new CandiateRanking[][] { new CandiateRanking[] { new CandiateRanking(0, 3), new CandiateRanking(1, 1) } };

            var s = new ESKeepThoseBetterThan(0.7);
            var r = s.RunStep(people, old);
            Assert.AreEqual(1, r.Length, "# of candidates ranked");
            Assert.AreEqual(0, r[0].candidate, "Incorrect candidate came back");
        }