Ejemplo n.º 1
0
 public async void NoPageWhenFeedNotFound()
 {
     await CheckSurveyNews(
         MockFeeds.NotFound,
         SurveyNewsPolicy.CheckOnceDay,
         LastChangedDates.Get(LastChangedDates.MoreThanAMonth),
         false,
         MockUrls.None,
         UpdatedLastChangedDates.Get(UpdatedLastChangedDates.Now)
         );
 }
Ejemplo n.º 2
0
 public async void NoPageWhenPolicyAndLastCheckDateRejected(SurveyNewsPolicy policy, int lastCheckedDate)
 {
     // When the check is done on project load in the background,
     // and the last check date and the policy determine the feed should NOT be retrieved,
     // then nothing will show.
     await CheckSurveyNews(
         MockFeeds.Items,
         policy,
         LastChangedDates.Get(lastCheckedDate),
         false,
         MockUrls.None,
         UpdatedLastChangedDates.Get(UpdatedLastChangedDates.Unchanged)
         );
 }
Ejemplo n.º 3
0
 public async void ErrorPageWhenFeedNotFoundAndForceCheck()
 {
     // When the user initiates the check via the menu command,
     // and the feed cannot be retrieved,
     // then an error will show.
     await CheckSurveyNews(
         MockFeeds.NotFound,
         SurveyNewsPolicy.Disabled,
         LastChangedDates.Get(LastChangedDates.Never),
         true,
         MockUrls.CannotConnect,
         UpdatedLastChangedDates.Get(UpdatedLastChangedDates.Now)
         );
 }
Ejemplo n.º 4
0
 public async void IndexPageWhenNoItemAvailableAndForceCheck(SurveyNewsPolicy policy)
 {
     // When the user initiates the check via the menu command,
     // and there are no available 'not voted' items in the feed,
     // then the index will show.
     await CheckSurveyNews(
         MockFeeds.NoItems,
         policy,
         LastChangedDates.Get(LastChangedDates.Never),
         true,
         MockUrls.Index,
         UpdatedLastChangedDates.Get(UpdatedLastChangedDates.Now)
         );
 }
Ejemplo n.º 5
0
 public async void NoPageWhenNoItemAvailable(SurveyNewsPolicy policy, int expectedUpdatedLastCheckDateIndex)
 {
     // When the check is done on project load in the background,
     // and there are no available 'not voted' items in the feed,
     // then nothing will show.
     await CheckSurveyNews(
         MockFeeds.NoItems,
         policy,
         LastChangedDates.Get(LastChangedDates.MoreThanAMonth),
         false,
         MockUrls.None,
         UpdatedLastChangedDates.Get(expectedUpdatedLastCheckDateIndex)
         );
 }
Ejemplo n.º 6
0
 public async void ItemPageWhenPolicyAndLastCheckDateAccepted(SurveyNewsPolicy policy, int lastCheckedDate)
 {
     // When the check is done on project load in the background,
     // and the last check date and the policy determine the feed should be retrieved,
     // and there are available 'not voted' items in the feed,
     // then the first available item will show.
     await CheckSurveyNews(
         MockFeeds.Items,
         policy,
         LastChangedDates.Get(lastCheckedDate),
         false,
         MockUrls.NotVoted1,
         UpdatedLastChangedDates.Get(UpdatedLastChangedDates.Now)
         );
 }
Ejemplo n.º 7
0
 public async void ItemPageBasedOnPolicyAndNeverCheckedBefore(SurveyNewsPolicy policy, string expectedUrl, int expectedUpdatedLastCheckedDate)
 {
     // When the check is done on project load in the background,
     // and the last check date has never been set,
     // the last check date is automatically set to 4 days ago,
     // the policy is evaluated against the new last check date,
     // then the first available item will only show if once a day, otherwise nothing will show.
     await CheckSurveyNews(
         MockFeeds.Items,
         policy,
         LastChangedDates.Get(LastChangedDates.Never),
         false,
         expectedUrl,
         UpdatedLastChangedDates.Get(expectedUpdatedLastCheckedDate)
         );
 }