Example #1
0
        public void UserIpTest()
        {
            var request = new MockServiceRequest <string>(new MockRequestProvider());

            request.UserIp = "FooBar";

            // Confirm that the E-tag and the behavior is passed along.
            MockRequest result = (MockRequest)request.BuildRequest();

            Assert.AreEqual("FooBar", result.UserIp);
        }
Example #2
0
        public void ETagTest()
        {
            var request = new MockServiceRequest <string>(new MockRequestProvider());

            request.ETag       = "FooBar";
            request.ETagAction = ETagAction.IfMatch;

            // Confirm that the E-tag and the behavior is passed along.
            MockRequest result = (MockRequest)request.BuildRequest();

            Assert.AreEqual("FooBar", result.ETag);
            Assert.AreEqual(ETagAction.IfMatch, result.ETagAction);
        }
Example #3
0
        public void ETagTypedBodyTest()
        {
            var mockBody = new Mock <IDirectResponseSchema>();

            mockBody.Setup(b => b.ETag).Returns("FooBar");

            var request = new MockServiceRequest <IDirectResponseSchema>(new MockRequestProvider());

            request.ETagAction = ETagAction.IfMatch;
            request.Body       = mockBody.Object;

            // Confirm that the E-tag and the behavior is passed along.
            MockRequest result = (MockRequest)request.BuildRequest();

            Assert.AreEqual("FooBar", result.ETag);
            Assert.AreEqual(ETagAction.IfMatch, result.ETagAction);
            mockBody.Verify();
        }