public void CreateQuestionDuplicator_RandomlySelectedQuestion_Throws() { var questionDuplicatorFactory = new QuestionDuplicatorFactory ( dbContext: null ); Assert.Throws <InvalidOperationException> ( () => questionDuplicatorFactory.CreateQuestionDuplicator ( new RandomlySelectedQuestion() ) ); }
public void CreateQuestionDuplicator_ReturnsCorrectType( Type questionType, Type expectedDuplicatorType) { var questionDuplicatorFactory = new QuestionDuplicatorFactory ( dbContext: null ); var result = questionDuplicatorFactory.CreateQuestionDuplicator ( (Question)Activator.CreateInstance(questionType) ); Assert.Equal(expectedDuplicatorType, result.GetType()); }