コード例 #1
0
        public void SendAsync_RequestNull()
        {
            var next = new Mock <IHttpService>(MockBehavior.Strict).Object;
            var uut  = new HttpReadService(next);

            Assert.ThrowsAsync <ArgumentNullException>(
                async() => await uut.SendAsync(null)
                );
        }
コード例 #2
0
        public async Task SendAsync()
        {
            var request  = new HttpRequestMessage();
            var response = new HttpResponseMessage();
            var next     = new Mock <IHttpService>(MockBehavior.Strict);

            next.Setup(n => n.SendAsync(request)).ReturnsAsync(response);
            var uut    = new HttpReadService(next.Object);
            var result = await uut.SendAsync(request);
        }