コード例 #1
0
        public void CreateRandomQuestionTypeListTest()
        {
            _questionType.SetAmountOfQuestion(QUESTION_AMOUNT, EXAMINATION_TYPE_ONE);
            _questionType.CreateRandomQuestionTypeList();
            _typeListTarget = new PrivateObject(_questionType);
            List <int> nullList = new List <int>();

            Assert.AreEqual(false, _typeListTarget.GetFieldOrProperty("_typeList").Equals(nullList));
            Assert.AreEqual(false, ((List <int>)_typeListTarget.GetFieldOrProperty("_typeList")).Contains(4));
            Assert.AreEqual(10, (((List <int>)_typeListTarget.GetFieldOrProperty("_typeList")).Count()));
            QuestionType questionTypeTwo = new QuestionType();

            questionTypeTwo.SetAmountOfQuestion(QUESTION_AMOUNT, EXAMINATION_TYPE_TWO);
            questionTypeTwo.CreateRandomQuestionTypeList();
            _typeListTarget = new PrivateObject(questionTypeTwo);
            Assert.AreEqual(false, ((List <int>)_typeListTarget.GetFieldOrProperty("_typeList")).Contains(1));
        }