Пример #1
0
        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);
        }
Пример #2
0
        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");
            }
        }
Пример #3
0
        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"));
        }