/// <summary>
        /// Creates dummy category
        /// </summary>
        /// <returns>Created Category object</returns>
        private DomainModel.Models.Category.Category CreateCategory()
        {
            var category = new DomainModel.Models.Category.Category
            {
                CategoryName = "Test Category"
            };

            return(category);
        }
Beispiel #2
0
        /// <summary>
        /// Create a category and return the category object
        /// </summary>
        /// <param name="categoryName">Name of the category</param>
        /// <returns>Returns the object of created category</returns>
        private DomainModel.Models.Category.Category CreateCategory(string categoryName)
        {
            var category = new DomainModel.Models.Category.Category
            {
                CategoryName = categoryName
            };

            return(category);
        }
        /// <summary>
        /// Creating a category
        /// </summary>
        /// <param categoryName="categoryName">Name of the category</param>
        /// <returns></returns>
        private DomainModel.Models.Category.Category CreateCategory(string categoryName)
        {
            var category = new DomainModel.Models.Category.Category
            {
                CategoryName    = categoryName,
                CreatedDateTime = DateTime.UtcNow
            };

            return(category);
        }
        /// <summary>
        /// Method to create a Category object for test
        /// </summary>
        /// <returns>Category object</returns>
        private DomainModel.Models.Category.Category CreateCategory()
        {
            var category = new DomainModel.Models.Category.Category
            {
                CategoryName    = "Test Category",
                CreatedDateTime = DateTime.UtcNow
            };

            return(category);
        }
Beispiel #5
0
        private async Task <QuestionAC> CreateSingleAnswerQuestion(DomainModel.Models.Category.Category categoryToCreate, string question)
        {
            var category = await _trappistDbContext.Category.AddAsync(categoryToCreate);

            var singleAnswerQuestion = new QuestionAC()
            {
                Question = new QuestionDetailAC()
                {
                    QuestionDetail  = question,
                    CategoryID      = category.Entity.Id,
                    DifficultyLevel = DifficultyLevel.Hard,
                    QuestionType    = QuestionType.Single
                },
                SingleMultipleAnswerQuestion = new SingleMultipleAnswerQuestionAC()
                {
                    SingleMultipleAnswerQuestion       = new SingleMultipleAnswerQuestion(),
                    SingleMultipleAnswerQuestionOption = new List <SingleMultipleAnswerQuestionOption>()
                    {
                        new SingleMultipleAnswerQuestionOption()
                        {
                            IsAnswer = true,
                            Option   = "A",
                        },
                        new SingleMultipleAnswerQuestionOption()
                        {
                            IsAnswer = false,
                            Option   = "B",
                        },
                        new SingleMultipleAnswerQuestionOption()
                        {
                            IsAnswer = false,
                            Option   = "C",
                        },
                        new SingleMultipleAnswerQuestionOption()
                        {
                            IsAnswer = false,
                            Option   = "D",
                        }
                    }
                }
            };

            return(singleAnswerQuestion);
        }
        /// <summary>
        /// Creates Coding Question
        /// </summary>
        /// <returns>Created CodingQuestion object</returns>
        private QuestionAC CreateCodingQuestion(DomainModel.Models.Category.Category categoryToCreate)
        {
            QuestionAC codingQuestion = new QuestionAC
            {
                Question = new QuestionDetailAC
                {
                    QuestionDetail  = "<h1>Write a program to add two number</h1>",
                    CategoryID      = categoryToCreate.Id,
                    DifficultyLevel = DifficultyLevel.Easy,
                    QuestionType    = QuestionType.Programming
                },
                CodeSnippetQuestion = new CodeSnippetQuestionAC
                {
                    CheckCodeComplexity          = true,
                    CheckTimeComplexity          = true,
                    RunBasicTestCase             = true,
                    RunCornerTestCase            = false,
                    RunNecessaryTestCase         = false,
                    LanguageList                 = new String[] { "Java", "C" },
                    CodeSnippetQuestionTestCases = new List <CodeSnippetQuestionTestCases>()
                    {
                        new CodeSnippetQuestionTestCases()
                        {
                            TestCaseTitle       = "Necessary check",
                            TestCaseDescription = "This case must be successfuly passed",
                            TestCaseMarks       = 10.00,
                            TestCaseType        = TestCaseType.Necessary,
                            TestCaseInput       = "2+2",
                            TestCaseOutput      = "4",
                        }
                    }
                },
                SingleMultipleAnswerQuestion = null
            };

            return(codingQuestion);
        }