public void IfModifiedSinceHeaderNotAddedWithNullArguments() { EnsureHeader.IfModifiedSince <Class>(Box, null); Assert.IsFalse(Box.Headers.ContainsKey("If-Modified-Since")); EnsureHeader.IfModifiedSince <Class>(Box, new RestFindOptions <Class> { IfModifiedSince = null }); Assert.IsFalse(Box.Headers.ContainsKey("If-Modified-Since")); }
public void IfModifiedSinceHeaderAddedWithValidArgument() { var challenge = DateTime.Now; Box.Headers = null; EnsureHeader.IfModifiedSince <Class>(Box, new RestFindOptions <Class> { IfModifiedSince = challenge }); Assert.IsTrue(Box.Headers.ContainsKey("If-Modified-Since")); var ifModifiedSince = DateTime.ParseExact(Box.Headers["If-Modified-Since"], CultureInfo.CurrentCulture.DateTimeFormat.RFC1123Pattern, CultureInfo.CurrentCulture); Assert.AreEqual(challenge.ToLongDateString(), ifModifiedSince.ToLongDateString()); }