コード例 #1
0
        public void WhenGameRulesRotationDictionaryDoesNotContainPieceType_InputValueIsReturned()
        {
            Dictionary <int, int> mockPieceRotations = new Dictionary <int, int>();

            mockPieceRotations.Add(3, 6);

            GameRules systemUnderTest = new GameRules();

            systemUnderTest.PieceRotations = mockPieceRotations;

            int pieceToRotateTo = systemUnderTest.GetGamePieceRotation(0);

            Assert.AreEqual(0, pieceToRotateTo);
        }
コード例 #2
0
        public void WhenGameRulesRotationDictionaryContainsPieceType_ReturnsMatchValue()
        {
            Dictionary <int, int> mockPieceRotations = new Dictionary <int, int>();

            mockPieceRotations.Add(3, 6);

            GameRules systemUnderTest = new GameRules();

            systemUnderTest.PieceRotations = mockPieceRotations;

            int pieceToRotateTo = systemUnderTest.GetGamePieceRotation(3);

            Assert.AreEqual(6, pieceToRotateTo);
        }