Exemplo n.º 1
0
        public void TestHtmlCachingOnLoggedInUsingIdentity()
        {
            Console.WriteLine("TestHtmlCachingOnNotLoggedInUsingIdentity");
            int expiryTime = 30;
            _siteId = SiteList.GetSite("identity606").SiteID;

            base.SetUseIdentity = true;
            SetHtmlCaching(true);
            SetHtmlCachingExpiryTime(expiryTime);
            RefreshSiteOptions();

            CreateXSLTFile("First call");

            DateTime start = DateTime.Now;

            DnaTestURLRequest request = new DnaTestURLRequest("identity606");
            request.SetCurrentUserAsIdentityTestUser();
            request.UseIdentitySignIn = true;
            string s = RequestPage(request);
            Assert.IsTrue(s.Contains("First call"), "Initial request doesn't contain correct string");

            CreateXSLTFile("Second call");

            s = RequestPage(request);
            Assert.IsTrue(s.Contains("Second call"), "Second request doesn't contain new string");

            DateTime end = DateTime.Now;

            // This test has to complete within a time limit
            TimeSpan ts = end.Subtract(start);
            Assert.IsTrue(ts.Seconds < expiryTime, "Test didn't complete in time");
        }