Esempio n. 1
0
        public void FeedManagerShouldReturnThrowIfFeedArgumentsAreFaulty()
        {
            var manager = new FeedManager();
            manager.GsaHostAddress = "http://google03.domain.se";

            Assert.Throws<ArgumentException>(() => manager.PushFeed(null));
        }
Esempio n. 2
0
        public void FeedManagerShouldReturnThrowIfGsaHostArgumentsAreFaulty()
        {
            var feed = new Feed();
            var record = new FeedRecord();
            record.Url = "http://www.claremont.se/test/";

            feed.Records.Add(record);

            var manager = new FeedManager();

            Assert.Throws<ArgumentException>(() => manager.PushFeed(feed));
        }
Esempio n. 3
0
        public void FeedManagerShouldReturnCorrectResult()
        {
            var feed = new Feed();
            var record = new FeedRecord();
            record.Url = "http://klaratest.domain.se/Info/Nyheter/Nyhet-Test-2-Reload/";

            feed.Records.Add(record);

            var manager = new FeedManager();
            manager.GsaHostAddress = "http://google03.domain.se";

            var succedingFeedClient = new Mock<IFeedClient>();
            succedingFeedClient.Setup(m => m.PushFeed(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<bool>())).Returns(HttpStatusCode.OK);

            manager.FeedClient = succedingFeedClient.Object;

            var result = manager.PushFeed(feed);

            Assert.AreEqual(HttpStatusCode.OK, result);
        }