コード例 #1
0
        public void GetUserHostAddressReturnsUserHostAddress()
        {
            var hr = new TestableHttpRequest {
                OnUserHostAddress = () => { return("123"); }
            };

            Assert.AreEqual("123", hr.GetUserHostAddress());
        }
コード例 #2
0
        public void GetUserHostAddressReturnsNullInCaseOfArgumentException()
        {
            var hr = new TestableHttpRequest {
                OnUserHostAddress = () => { throw new ArgumentException(); }
            };

            Assert.IsNull(hr.GetUserHostAddress());
        }
        public void GetUserHostAddressReturnsUserHostAddress()
        {
            var hr = new TestableHttpRequest { OnUserHostAddress = () => { return "123"; } };

            Assert.AreEqual("123", hr.GetUserHostAddress());
        }
        public void GetUserHostAddressReturnsNullInCaseOfArgumentException()
        {
            var hr = new TestableHttpRequest { OnUserHostAddress = () => { throw new ArgumentException(); } };

            Assert.IsNull(hr.GetUserHostAddress());
        }