public void FeedManagerShouldReturnThrowIfFeedArgumentsAreFaulty() { var manager = new FeedManager(); manager.GsaHostAddress = "http://google03.domain.se"; Assert.Throws<ArgumentException>(() => manager.PushFeed(null)); }
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)); }
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); }