예제 #1
0
        public void MyTestInitialize()
        {
            DictionaryForPlayer1.Clear();
            DictionaryForPlayer2.Clear();

            Assert.AreEqual(0, DictionaryForPlayer1.Count);
            Assert.AreEqual(0, DictionaryForPlayer2.Count);
        }
예제 #2
0
        public void AddingTwoPlayers()
        {
            const string player1 = "player1";
            const string player2 = "player2";

            string value;

            GameMapper.Add(player1, player2);

            Assert.AreEqual(1, DictionaryForPlayer1.Count);
            Assert.AreEqual(1, DictionaryForPlayer2.Count);

            Assert.IsTrue(DictionaryForPlayer1.ContainsKey(player1));
            Assert.IsTrue(DictionaryForPlayer2.ContainsKey(player2));

            Assert.IsTrue(DictionaryForPlayer1.TryGetValue(player1, out value));
            Assert.AreEqual(player2, value);

            Assert.IsTrue(DictionaryForPlayer2.TryGetValue(player2, out value));
            Assert.AreEqual(player1, value);
        }