Beispiel #1
0
        public void SetPosition_InsertCharacterPosition_CheckPositionProperty()
        {
            // Arrange
            char character = 'd';
            RotorTestClass RotorTestClass = new RotorTestClass();

            // Act
            RotorTestClass.SetPosition(character);

            // Assert
            Assert.AreEqual(4, RotorTestClass.GetPosition());
        }
Beispiel #2
0
        public void Rotate_InsertStartingPosition_ExpectingNotchAndPositionIs25()
        {
            // Arrange
            char character = 'x';
            RotorTestClass RotorTestClass = new RotorTestClass();
            RotorTestClass.SetPosition(character);

            // Act
            bool notch = RotorTestClass.Rotate();

            // Assert
            Assert.IsTrue(notch);
            Assert.AreEqual(25, RotorTestClass.GetPosition());
        }
Beispiel #3
0
        public void Rotate_InsertStartingPositionAndRotateTwice_ExpectingCharacterAToBecomeM()
        {
            // Arrange
            char character = 'A';
            RotorTestClass RotorTestClass = new RotorTestClass();
            RotorTestClass.SetPosition(character);

            // Act
            RotorTestClass.Rotate();
            RotorTestClass.Rotate();

            // Assert
            /// START  A---E
            /// 1 TURN A---K
            /// 2 TURN A---M

            Assert.AreEqual('M', RotorTestClass.RotatedWiring[character]);
        }