Beispiel #1
0
        public void GetByQueryString__Int32()
        {
            //Arrange
            var request = new Mock <HttpRequestBase>();

            request.SetupGet(x => x.QueryString).Returns(() =>
            {
                NameValueCollection param = new NameValueCollection();
                param.Add("id", "10");
                return(param);
            });
            var expected = 10;

            //Act
            RequestWrapper wrapper = new RequestWrapper(request.Object);
            var            result  = wrapper.GetByQueryString <Int32>("id");

            //Assert
            Assert.AreEqual(expected, result);
        }