Exemplo n.º 1
0
        public override Expression <Func <DatabaseTest, bool> > ToExpression()
        {
            var types = QuestionTypeHelper.GetSupportedTypes();

            return(x => x.IsActive &&
                   x.TestThemes
                   .Select(y => y.Theme)
                   .SelectMany(y => y.Questions)
                   .Any(z => types.Contains(z.Type)));
        }
Exemplo n.º 2
0
        public override Expression <Func <DatabaseDiscipline, bool> > ToExpression()
        {
            var types = QuestionTypeHelper.GetSupportedTypes();

            return(x => x.Tests
                   .Where(y => y.IsActive)
                   .SelectMany(y => y.TestThemes)
                   .Select(y => y.Theme)
                   .SelectMany(y => y.Questions)
                   .Any(y => types.Contains(y.Type)));
        }
Exemplo n.º 3
0
        public void QuestionTypeHelperGetTestCategoryTest()
        {
            var actualQuestionTypeID1 = QuestionTypeHelper.GetTestCategoryTitle(validQuestionTypeID1);

            Assert.Equal(validQuestionTypeName1, actualQuestionTypeID1);

            var actualQuestionTypeID2 = QuestionTypeHelper.GetTestCategoryTitle(validQuestionTypeID2);

            Assert.Equal(validQuestionTypeName2, actualQuestionTypeID2);

            var actualQuestionTypeID3 = QuestionTypeHelper.GetTestCategoryTitle(validQuestionTypeID3);

            Assert.Equal(validQuestionTypeName3, actualQuestionTypeID3);
        }
Exemplo n.º 4
0
        public override Expression <Func <DatabaseTheme, bool> > ToExpression()
        {
            var types = QuestionTypeHelper.GetSupportedTypes();

            return(x => x.Questions.Any(y => types.Contains(y.Type)) && x.ThemeTests.Any(y => y.Test.IsActive));
        }