public void ReadPageAsync_BadUrl() { var next = new Mock <IReadPageService <Uom> >(MockBehavior.Strict); var uut = new ReadPageService <Uom>(next.Object); Assert.ThrowsAsync <ArgumentException>( async() => await uut.ReadPageAsync("abc") ); }
public async Task ReadPageAsync() { var url = "http://qtb3.com/a/b"; var expectedData = new Mock <ICollectionPageData <Uom> >(MockBehavior.Strict).Object; var next = new Mock <IReadPageService <Uom> >(MockBehavior.Strict); next.Setup(n => n.ReadPageAsync(url)).ReturnsAsync(expectedData); var uut = new ReadPageService <Uom>(next.Object); var actualData = await uut.ReadPageAsync(url); Assert.AreEqual(expectedData, actualData); }