Example #1
0
        public void TestNumGen3()
        {
            //Arrange
            oscillateA OS = new oscillateA();
            int        numGenCount;

            //Act
            OS.next();
            OS.next();
            OS.reset();
            numGenCount = OS.numGen();
            //Assert
            Assert.AreEqual(0, numGenCount);
        }
Example #2
0
        public void TestNext3()
        {
            //Arrange
            int        commonDiff = 4;
            oscillateA OS         = new oscillateA(commonDiff);
            int        nextcall;

            //Act
            OS.next();
            OS.next();
            nextcall = OS.next();
            //Assert
            Assert.AreEqual(12, nextcall);
        }
Example #3
0
        public void TestNext5()
        {
            //Arrange
            int        commonDiff = 2;
            int        calls      = 6;
            oscillateA OS         = new oscillateA(commonDiff);

            int[] forbidden = { 10, 12, 14, 16, 18 };
            OS.setForbiddenSet(forbidden);
            int nextcall;

            //Act
            for (int i = 0; i < calls; i++)
            {
                OS.next();
            }
            nextcall = OS.next();
            //Assert
            Assert.AreEqual(1, nextcall);
        }
Example #4
0
        public void TestNext1()
        {
            //Arrange
            oscillateA OS = new oscillateA();
            int        nextcall;

            //Act
            nextcall = OS.next();
            //Assert
            Assert.AreEqual(2, nextcall);
        }
Example #5
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);
        }