Exemple #1
0
 public SetCookieComparer(CookieComparison comparisonCriteria)
     : this(comparisonCriteria, TimeSpan.FromMinutes(1))
 {
 }
Exemple #2
0
        public static SetCookieHeaderValue HasCookie(string name, HttpResponseMessage response, CookieComparison comparison)
        {
            var setCookieHeaderValue = new SetCookieHeaderValue(new StringSegment(name));
            var foundCookie          = HasCookieCore(setCookieHeaderValue, response, new SetCookieComparer(comparison));

            if (foundCookie != null)
            {
                return(foundCookie);
            }

            var suffix = comparison.HasFlag(CookieComparison.NameStartsWith) ? "starting with" : "";

            Assert.True(false, $"Couldn't find a cookie with a name {suffix} '{name}'");

            return(null);
        }
Exemple #3
0
 public SetCookieComparer(CookieComparison comparisonCriteria, TimeSpan skewAllowance)
 {
     _comparisonCriteria = comparisonCriteria;
     _skewAllowance      = skewAllowance;
 }