Beispiel #1
0
        private Poll ParsePoll()
        {
            string pubs  = "3 7";
            string votes = "3 1 1";

            return(BeerPressure.ParseLines(pubs, votes));
        }
Beispiel #2
0
        public void RunPoll()
        {
            Poll poll = ParsePoll();

            Poll result = BeerPressure.DeterminePollResult(poll);

            Assert.AreEqual(28.0 / 30, result.Pubs.FirstOrDefault(x => x.Id == 1).Chance);
            Assert.AreEqual(1.0 / 30, result.Pubs.FirstOrDefault(x => x.Id == 2).Chance);
            Assert.AreEqual(1.0 / 30, result.Pubs.FirstOrDefault(x => x.Id == 3).Chance);
        }