public void InitializationSavedTest() { SurveyMock.RemoveAllSurveys(); SurveyMock.GenerateResponseSets(RESPONSE_SETS_COUNT); DataAccessModels.Repositories.ResponseSetRepository respository = new DataAccessModels.Repositories.ResponseSetRepository(); var items = respository.GetAllResponseSetsForUser(Membership.CurrentUser.ID); var responseSets = new System.Collections.ObjectModel.ObservableCollection <DataAccessModels.ResponseSet>(items); this.InitializationResponseSetViewModel(ResponseSetsType.Saved, "TopResponses"); }
public void InitializationTest() { MySurveysViewModel mySurvey = new MySurveysViewModel(); SurveyMock.RemoveAllSurveys(); SurveyMock.GenerateSurveys(SURVEYS_COUNT); mySurvey.InitializeViewModelCommand.Execute(null); Assert.AreEqual(MySurveysViewModel.TOP_SURVYES_COUNT, mySurvey.TopSurveys.Count); Assert.AreEqual(0, mySurvey.DisplayedSurveyses.Count); Assert.AreEqual(string.Empty, mySurvey.SearchText); }
public void InitializationOnSearchTest() { AddPageParameters(MySurveysViewModel.IS_FOR_SEARCHING + "=true"); MySurveysViewModel mySurvey = new MySurveysViewModel(); SurveyMock.RemoveAllSurveys(); SurveyMock.GenerateSurveys(SURVEYS_COUNT); mySurvey.InitializeViewModelCommand.Execute(null); Assert.AreEqual(SURVEYS_COUNT, mySurvey.DisplayedSurveyses.Count); Assert.AreEqual(0, mySurvey.TopSurveys.Count); ClearPageParameters(); }
private bool DeleteResponseSet(ResponseSetsType viewModelType, ResponseSetType responseType) { SurveyMock.RemoveAllSurveys(); bool isCompleted = false; var survey = SurveyMock.GenerateAndSaveSurvey(SURVEY_ID); var responseSet = SurveyMock.GenerateAndSaveResponseSet(responseType, survey); ResponseSetsViewModel viewModel = new ResponseSetsViewModel(viewModelType); viewModel.TestCompleted += (sender, args) => { if (args.Message == RESPONSE_DELETED) { Assert.AreEqual(0, viewModel.DisplayedResponses.Count); Assert.AreEqual(0, viewModel.TopResponses.Count); isCompleted = true; } }; viewModel.DeleteResponseSetCommand.Execute(responseSet); return(isCompleted); }
public void InitializationSubmittedTest() { SurveyMock.RemoveAllSurveys(); SurveyMock.GenerateResponseSets(RESPONSE_SETS_COUNT); this.InitializationResponseSetViewModel(ResponseSetsType.Submitted, "TopResponses"); }