Exemplo n.º 1
0
        public void TestDefaultConstructorSetsNameAndValue()
        {
            var attribute = new SetCookieAttribute("TestName", "TestValue");

            Assert.AreEqual("TestName", attribute.Name);
            Assert.AreEqual("TestValue", attribute.Value);
            Assert.AreEqual("/", attribute.Path);
        }
Exemplo n.º 2
0
        public void TestSetPathOverridesDefaultValue()
        {
            var attribute = new SetCookieAttribute("TestName", "TestValue")
            {
                Path = "/MyDomain"
            };

            Assert.AreEqual("TestName", attribute.Name);
            Assert.AreEqual("TestValue", attribute.Value);
            Assert.AreEqual("/MyDomain", attribute.Path);
        }
Exemplo n.º 3
0
        public void TestToStringReturnsValues()
        {
            var attribute = new SetCookieAttribute("TestName", "TestValue")
            {
                Path = "/MyDomain"
            };

            var result = attribute.ToString();

            StringAssert.Contains("Name: TestName", result);
            StringAssert.Contains("Value: TestValue", result);
            StringAssert.Contains("Path: /MyDomain", result);
        }