Example #1
0
        //generate Bid
        private void button1_Click(object sender, EventArgs e)
        {
            BidGenerator bg = new BidGenerator();

            bg.GenerateBids();
            Dictionary <string, int> bids = _dbh.GetBids();

            listBox1.Items.Clear();
            foreach (var kvp in bids)
            {
                listBox1.Items.Add(kvp);
            }
        }
Example #2
0
        public static void ExecuteTest()
        {
            var fasesWithOffset   = JsonConvert.DeserializeObject <Dictionary <Fase, bool> >(File.ReadAllText("FasesWithOffset.json"));
            var bidGenerator      = new BidGenerator();
            var expectedSouthBids = JsonConvert.DeserializeObject <Dictionary <string, string> >(File.ReadAllText("expectedSouthBidsPerHand.json"));

            Pinvoke.Setup("Tosr.db3");
            foreach (var(hand, expectedBids) in expectedSouthBids)
            {
                var generatedAuction   = BidManager.GetAuction(hand, bidGenerator, fasesWithOffset);
                var generatedSouthBids = generatedAuction.GetBidsAsString(Player.South);
                Assert.Equal(expectedBids, generatedSouthBids);
            }
        }