Skip to content

Instantly share code, notes, and snippets.

@MarcosMeli
Created May 26, 2016 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarcosMeli/a10278cdba53fd42808d275eeef9b1fe to your computer and use it in GitHub Desktop.
Save MarcosMeli/a10278cdba53fd42808d275eeef9b1fe to your computer and use it in GitHub Desktop.
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