Created
May 26, 2016 14:06
-
-
Save MarcosMeli/a10278cdba53fd42808d275eeef9b1fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
namespace DotCheck.Models | |
{ | |
public class QuestionFactory | |
{ | |
public static List<ExamQuestion> FromConfig(ExamConfig config) | |
{ | |
var res = new List<ExamQuestion>(); | |
var currentCategory = ""; | |
if (config.DotNetBasics) | |
{ | |
currentCategory = QuestionCategories.DotNetBasics; | |
res.Add(new ExamQuestion() | |
{ Id = "BasicExtensionMethods", | |
Title = "You are familiar with <strong>Extension Methods</strong> ?", | |
Description = "", | |
Options = QuestionOption.NoAlittleYes, | |
Category = currentCategory | |
}); | |
res.Add(new ExamQuestion() | |
{ | |
Id = "BasicValueTypes", | |
Title = "You are familiar with <strong>Value Types</strong> ?", | |
Description = "", | |
Options = QuestionOption.NoAlittleYes, | |
Category = currentCategory | |
}); | |
res.Add(new ExamQuestion() | |
{ | |
Id = "BasicNullableTypes", | |
Title = "You are familiar with <strong>Nullable Types</strong> ?", | |
Description = "For value types like int?, DateTime?", | |
Options = QuestionOption.NoAlittleYes, | |
Category = currentCategory | |
}); | |
} | |
if (config.DotNetIntermediate) | |
{ | |
currentCategory = QuestionCategories.DotNetIntermediate; | |
res.Add(new ExamQuestion() | |
{ | |
Id = "IntermediateLambda", | |
Title = "You are familiar with <strong>Lambda Expressions</strong> ?", | |
Description = "list.FindAll(x => x.Field1 = true)", | |
Options = QuestionOption.NoAlittleYes, | |
Category = currentCategory | |
}); | |
res.Add(new ExamQuestion() | |
{ | |
Id = "IntermediateExceptionsRethrow", | |
Title = "Do You know how to <strong>re throw exceptions</strong> ?", | |
Description = "", | |
Options = QuestionOption.NoAlittleYes, | |
Category = currentCategory | |
}); | |
} | |
if (config.DotNetIntermediate) | |
{ | |
currentCategory = QuestionCategories.DotNetAdvanced; | |
res.Add(new ExamQuestion() | |
{ | |
Id = "AvancedBoxing", | |
Title = "Do You know what <strong>Boxing and Un-boxing</strong> are ?", | |
Description = "", | |
Options = QuestionOption.NoAlittleYes, | |
Category = currentCategory | |
}); | |
res.Add(new ExamQuestion() | |
{ | |
Id = "AvancedGarbageCollector", | |
Title = "Do You know how the <strong>Garbage Collector</strong> works?", | |
Description = "", | |
Options = QuestionOption.NoAlittleYes, | |
Category = currentCategory | |
}); | |
} | |
return res; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment