示例#1
0
        public void RestInvokerAddCookie_overload2()
        {
            //Arrange
            RestInvoker target = new RestInvoker(_MyUri.OriginalString);
            target.AddCookie(new System.Net.Cookie("cookie1", "cookieValue1"));
            StubModule.Cookie = null;
            StubModule.HaltProcessing = TimeSpan.FromSeconds(0);
            StubModule.GetPerson = false;
            StubModule.TestHarness = new List<Person> { new Person { Id = 1, Email = "*****@*****.**" } };

            //Act
            using (RestResponse actual = target.Get("/Person/{id}", new { id = 1 }))
            {
                //Assert
                Assert.NotNull(StubModule.Cookie);
                Assert.Equal("cookieValue1", StubModule.Cookie["cookie1"]);
            }

        }