예제 #1
0
        public void TestModeOnInitialization1()
        {
            //Arrange
            oscillateA OS = new oscillateA();
            string     mode;

            //Act
            mode = OS.getMode();
            //Assert
            Assert.AreEqual("advance", mode);
        }
예제 #2
0
        public void TestModeOnInitialization2()
        {
            //Arrange
            int        commonDiff = 3;
            oscillateA OS         = new oscillateA(commonDiff);
            string     mode;

            //Act
            mode = OS.getMode();
            //Assert
            Assert.AreEqual("advance", mode);
        }
예제 #3
0
        public void TestSwitchModes1()
        {
            //Arrange
            oscillateA OS = new oscillateA();
            string     mode;

            //Act
            OS.switchMode();
            mode = OS.getMode();
            //Assert
            Assert.AreEqual("retreat", mode);
        }
예제 #4
0
        public void TestMode1()
        {
            //Arrange
            int        commonDiff = 2;
            int        calls      = 6;
            oscillateA OS         = new oscillateA(commonDiff);

            int[]  forbidden = { 6, 8, 10, 12, 14 };
            string mode;

            //Act
            for (int i = 0; i < calls; i++)
            {
                OS.next();
            }
            mode = OS.getMode();
            //Assert
            Assert.AreEqual("forbidden advance", mode);
        }