Ejemplo n.º 1
0
        public void ToStringTest_Successful()
        {
            var cacheCowHeader = new CacheCowHeader()
                                 	{
                                 		CacheValidationApplied = true,
                                 		DidNotExist = false
                                 	};

            var s = cacheCowHeader.ToString();
            Console.WriteLine(s);
            Assert.IsTrue(s.StartsWith(_version));
            Assert.IsTrue(s.IndexOf(CacheCowHeader.ExtensionNames.CacheValidationApplied + "=true") > 0);
            Assert.IsTrue(s.IndexOf(CacheCowHeader.ExtensionNames.DidNotExist + "=false") > 0);
        }
		public static HttpResponseMessage AddCacheCowHeader(this HttpResponseMessage response,
			CacheCowHeader header)
		{
			response.Headers.Add(CacheCowHeader.Name, header.ToString());
			return response;
		}