コード例 #1
0
        public void TestModeOnInitialization1()
        {
            //Arrange
            arithS AS = new arithS();
            string mode;

            //Act
            mode = AS.getMode();
            //Assert
            Assert.AreEqual("advance", mode);
        }
コード例 #2
0
        public void TestModeOnInitialization2()
        {
            //Arrange
            int    commonDiff = 3;
            arithS AS         = new arithS(commonDiff);
            string mode;

            //Act
            mode = AS.getMode();
            //Assert
            Assert.AreEqual("advance", mode);
        }
コード例 #3
0
        public void TestSwitchModes1()
        {
            //Arrange
            arithS AS = new arithS();
            string mode;

            //Act
            AS.switchMode();
            mode = AS.getMode();
            //Assert
            Assert.AreEqual("retreat", mode);
        }
コード例 #4
0
        public void TestMode1()
        {
            //Arrange
            int    commonDiff = 2;
            int    calls      = 6;
            arithS AS         = new arithS(commonDiff);

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

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