public void WhenProvidedData_ShouldLoadQuestionnaire() { var model = new QuestionnaireModel(Guid.NewGuid(), ""); var qmodel1 = new QuestionModel( Guid.NewGuid(), Guid.NewGuid(), "1", true, false, new BooleanQuestionType()); var qmodel2 = new QuestionModel( Guid.NewGuid(), Guid.NewGuid(), "2", true, false, new BooleanQuestionType()); model.Questions.Add(qmodel1); model.Questions.Add(qmodel2); var wrappedModel = new QuestionnaireWrapper(model); var dataProviderMock = new Mock <IQuestionnaireDataProvider>(); dataProviderMock .Setup(x => x.GetSingleQuestionnaire()) .Returns(wrappedModel); var viewModel = new QuestionnaireViewModel(dataProviderMock.Object); viewModel.Load(); Assert.AreEqual(2, viewModel.Questionnaire.Questions.Count); }