public void CreationMySurveys()
        {
            MySurveysViewModel mySurveys = new MySurveysViewModel();

            Assert.AreEqual(string.Empty, mySurveys.SearchText);
            Assert.AreEqual(0, mySurveys.TopSurveys.Count, mySurveys.DisplayedSurveyses.Count);
            Assert.IsFalse(mySurveys.IsBusy);
            Assert.IsTrue(mySurveys.DeleteSurveyCommand.CanExecute(null));
        }
        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();
        }
Example #4
0
 public MySurveysPage(bool loadOnly)
 {
     InitializeComponent();
     _viewModel     = new MySurveysViewModel(loadOnly);
     BindingContext = _viewModel;
 }