コード例 #1
0
        public void QuestionTest_Check_Last_Category_ID_Equals_Number_Of_Lists_With_Question()
        {
            //Arrange
            CreateAllCategoriesAndQuestion createAllCategoriesAndQuestion = new CreateAllCategoriesAndQuestion();
            CategoryManager categoryManager = new CategoryManager();

            categoryManager.OpenCategory();
            var numberOfCategories = categoryManager.LastIdOnList();
            //Act
            var listOfListsWithQuestion = createAllCategoriesAndQuestion.CreateListsToQuestionOfEachCategory();

            //Assert
            Assert.Equal(numberOfCategories, listOfListsWithQuestion.Count);
        }
コード例 #2
0
        public void Checking_If_ShowQuestionAndAnswer_Method_Correctly_Returning_First_Question_By_Checking_Components_Of_This_Question()
        {
            //Arrange
            CreateAllCategoriesAndQuestion createAllCategoriesAndQuestion = new CreateAllCategoriesAndQuestion();
            var listOfQuestions = createAllCategoriesAndQuestion.CreateListsToQuestionOfEachCategory();
            ShowAndDeleteQuestionAndAnswersService showAndDeleteQuestionAndAnswersService = new ShowAndDeleteQuestionAndAnswersService();
            //Act
            var objectWithQuestion    = showAndDeleteQuestionAndAnswersService.ShowQuestionAndAnswerOfCategory(listOfQuestions[0]);
            var idOfRandomingQuestion = objectWithQuestion.IdQuestion;

            //Assert
            Assert.InRange(idOfRandomingQuestion, 0, listOfQuestions[0].Count);
            Assert.Equal(objectWithQuestion.Question, listOfQuestions[0][idOfRandomingQuestion].Question);
            Assert.Equal(objectWithQuestion.GoodAnswer, listOfQuestions[0][idOfRandomingQuestion].GoodAnswer);
        }