示例#1
0
        public void ShouldReturnHttpWebResponse()
        {
            //Arrange
            var defaultHttpRequester = new DefaultHttpRequester();
            var webRequest           = WebRequest.Create("https://www.google.fr");

            //Act
            var response = defaultHttpRequester.GetResponse(webRequest);

            //Assert
            Assert.IsNotNull(response);
        }
示例#2
0
        public void ShouldThrowArgumentNullException()
        {
            //Arrange
            var defaultHttpRequester = new DefaultHttpRequester();

            //Act
            var ex = Assert.ThrowsException <ArgumentNullException>(() =>
            {
                defaultHttpRequester.GetResponse(null);
            });

            //Assert
            Assert.AreEqual("request", ex.ParamName);
        }