public void GetFeedResponsesFromFeedRssUrisTest() { // arrange DashboardHttp http = null; HttpContextBase httpContext = null; string pathToFeedsFileSource = Setup.GetDataPath(); UriDatasource target = new UriDatasource(http, httpContext, pathToFeedsFileSource); RssIssues actual; // act actual = target.Get(); // assert Assert.IsNotNull(actual); Assert.IsNotNull(actual.Issues); Assert.IsTrue((actual.RetrievalDate - DateTime.UtcNow).Days < 1); Assert.GreaterOrEqual(actual.Issues.ToList().Count, 70); }
public void SetTest() { // arrange DashboardHttp http = null; HttpContextBase httpContext = null; string pathToFeedsFileSource = string.Empty; UriDatasource target = new UriDatasource(http, httpContext, pathToFeedsFileSource); // act try { target.Set(); Assert.Fail("exception not thrown"); } catch (NotImplementedException) { Assert.Pass(); } catch { Assert.Fail("Invalid exception"); } }
public void UriDatasourceConstructorTest() { // arrange DashboardHttp http = null; HttpContextBase httpContext = null; string pathToFeedsFileSource = string.Empty; Setup.GetDataPath(); // act UriDatasource target = new UriDatasource(http, httpContext, pathToFeedsFileSource); // assert Assert.IsNotNull(target); Assert.IsNull(target.DashboardHttp); Assert.IsNull(target.DashboardUri); Assert.IsNull(target.RssIssues); Assert.IsNotNull(target.SerializedFilename); Assert.That(target.SerializedFilename.Contains("IssueFileDatasource")); }