77 references to FromDays
AuthSamples.FunctionalTests (4)
CustomPolicyProviderTests.cs (4)
51var signIn = await SignIn(Client, "Dude", DateTime.Now.Subtract(TimeSpan.FromDays(365 * 20)).ToString(DateTimeFormatInfo.InvariantInfo.ShortDatePattern, CultureInfo.InvariantCulture)); 67var signIn = await SignIn(Client, "Dude", DateTime.Now.Subtract(TimeSpan.FromDays(365 * 5)).ToString(DateTimeFormatInfo.InvariantInfo.ShortDatePattern, CultureInfo.InvariantCulture)); 82var signIn = await SignIn(Client, "Dude", DateTime.Now.Subtract(TimeSpan.FromDays(365 * 55)).ToString(DateTimeFormatInfo.InvariantInfo.ShortDatePattern, CultureInfo.InvariantCulture)); 98var signIn = await SignIn(Client, "Dude", DateTime.Now.Subtract(TimeSpan.FromDays(365 * 20)).ToString(DateTimeFormatInfo.InvariantInfo.ShortDatePattern, CultureInfo.InvariantCulture));
dotnet-dev-certs (1)
Program.cs (1)
48public static readonly TimeSpan HttpsCertificateValidity = TimeSpan.FromDays(365);
EntityFrameworkCoreSample (1)
Program.cs (1)
29.SetDefaultKeyLifetime(TimeSpan.FromDays(7))
HttpAbstractions.SampleApp (1)
Program.cs (1)
43response.Cookies.Append("Cookie1", "value1", new CookieOptions() { Expires = DateTimeOffset.UtcNow + TimeSpan.FromDays(1) });
HttpsPolicySample (1)
Startup.cs (1)
22options.MaxAge = TimeSpan.FromDays(30);
InMemory.FunctionalTests (1)
Http2\Http2TimeoutTests.cs (1)
959AdvanceTime(TimeSpan.FromDays(1));
Microsoft.AspNetCore.Authentication.BearerToken (1)
BearerTokenOptions.cs (1)
41public TimeSpan RefreshTokenExpiration { get; set; } = TimeSpan.FromDays(14);
Microsoft.AspNetCore.Authentication.Cookies (1)
CookieAuthenticationOptions.cs (1)
30ExpireTimeSpan = TimeSpan.FromDays(14);
Microsoft.AspNetCore.Authentication.Test (3)
CookieTests.cs (3)
208_timeProvider.Advance(TimeSpan.FromDays(60)); 243_timeProvider.Advance(TimeSpan.FromDays(60)); 290o.Cookie.Expiration = TimeSpan.FromDays(10);
Microsoft.AspNetCore.Components.Server.Tests (1)
Circuits\CircuitPersistenceManagerTest.cs (1)
541TimeSpan.FromDays(365));
Microsoft.AspNetCore.CookiePolicy (1)
CookiePolicyOptions.cs (1)
48Expiration = TimeSpan.FromDays(365),
Microsoft.AspNetCore.CookiePolicy.Test (1)
CookieConsentTests.cs (1)
223Assert.True(consentCookie.Expires.Value > DateTimeOffset.Now + TimeSpan.FromDays(364));
Microsoft.AspNetCore.DataProtection (4)
Internal\KeyManagementOptionsSetup.cs (1)
52options.NewKeyLifetime = TimeSpan.FromDays(context.DefaultKeyLifetime.Value);
KeyManagement\KeyManagementOptions.cs (3)
18private static readonly TimeSpan _keyPropagationWindow = TimeSpan.FromDays(2); 21private TimeSpan _newKeyLifetime = TimeSpan.FromDays(90); 132if (value < TimeSpan.FromDays(7))
Microsoft.AspNetCore.DataProtection.Tests (21)
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorDeserializerTests.cs (1)
51DateTimeOffset.Now + TimeSpan.FromDays(30),
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorTests.cs (1)
206DateTimeOffset.Now + TimeSpan.FromDays(30),
AuthenticatedEncryption\ConfigurationModel\CngCbcAuthenticatedEncryptorDescriptorDeserializerTests.cs (1)
58DateTimeOffset.Now + TimeSpan.FromDays(30),
AuthenticatedEncryption\ConfigurationModel\CngGcmAuthenticatedEncryptorDescriptorDeserializerTests.cs (1)
55expirationDate: DateTimeOffset.Now + TimeSpan.FromDays(30),
AuthenticatedEncryption\ConfigurationModel\ManagedAuthenticatedEncryptorDescriptorDeserializerTests.cs (1)
156DateTimeOffset.Now + TimeSpan.FromDays(30),
Internal\KeyManagementOptionsSetupTest.cs (1)
66Assert.Equal(TimeSpan.FromDays(1024), options.NewKeyLifetime);
KeyManagement\DefaultKeyResolverTests.cs (2)
262var expiration1 = creation1 + TimeSpan.FromDays(90); 263var expiration2 = creation2 + TimeSpan.FromDays(90);
KeyManagement\KeyRingProviderTests.cs (11)
118Tuple.Create((DateTimeOffset)now, (DateTimeOffset)now + TimeSpan.FromDays(90), CreateKey()) 166Tuple.Create(now, now + TimeSpan.FromDays(90), newKey) 207Tuple.Create((DateTimeOffset)now, (DateTimeOffset)now + TimeSpan.FromDays(90), newlyCreatedKey) 251Tuple.Create((DateTimeOffset)now, (DateTimeOffset)now + TimeSpan.FromDays(90), CreateKey()) 291Tuple.Create(key1.ExpirationDate, (DateTimeOffset)now + TimeSpan.FromDays(90), CreateKey()) 449var generatedKey = CreateKey(expiration1, now + TimeSpan.FromDays(90)); 504Tuple.Create(expiration1, now + TimeSpan.FromDays(90), CreateKey()) 525DateTimeOffset activation = now - TimeSpan.FromDays(30); 526DateTimeOffset expiration = now + TimeSpan.FromDays(30); 529var generatedKey = CreateKey(expiration, now + TimeSpan.FromDays(90)); 539Tuple.Create(expiration, now + TimeSpan.FromDays(90), generatedKey)
KeyManagement\KeyRingTests.cs (1)
103ExpirationDate = CreationDate + TimeSpan.FromDays(30);
KeyManagement\XmlKeyManagerTests.cs (1)
295DateTimeOffset activationDate = minCreationDate + TimeSpan.FromDays(7);
Microsoft.AspNetCore.HttpsPolicy (1)
HstsOptions.cs (1)
18public TimeSpan MaxAge { get; set; } = TimeSpan.FromDays(30);
Microsoft.AspNetCore.Identity (1)
DataProtectionTokenProviderOptions.cs (1)
25public TimeSpan TokenLifespan { get; set; } = TimeSpan.FromDays(1);
Microsoft.AspNetCore.Identity.Test (4)
SecurityStampValidatorTest.cs (4)
245options.Setup(a => a.Value).Returns(new SecurityStampValidatorOptions { ValidationInterval = TimeSpan.FromDays(1) }); 301IssuedUtc = timeProvider.GetUtcNow() - TimeSpan.FromDays(1), 302ExpiresUtc = timeProvider.GetUtcNow() + TimeSpan.FromDays(1), 316Assert.Equal(now + TimeSpan.FromDays(1), context.Properties.ExpiresUtc);
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
AntiforgeryMiddlewareTest.cs (1)
250public DateTime DueDate { get; set; } = DateTime.Now.Add(TimeSpan.FromDays(1));
Microsoft.AspNetCore.OutputCaching.Tests (7)
MemoryOutputCacheStoreTests.cs (6)
70await store.SetAsync(key, value, tags, TimeSpan.FromDays(1), default); 99await store.SetAsync(key1, value, tags, TimeSpan.FromDays(1), default); 100await store.SetAsync(key2, value, tags, TimeSpan.FromDays(1), default); 118await store.SetAsync(key, value, tags, TimeSpan.FromDays(1), default); 136await store.SetAsync(key1, value, tags1, TimeSpan.FromDays(1), default); 137await store.SetAsync(key2, value, tags2, TimeSpan.FromDays(1), default);
OutputCachePoliciesTests.cs (1)
80var duration = TimeSpan.FromDays(1);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
KestrelServerTests.cs (1)
745testContext.FakeTimeProvider.Advance(TimeSpan.FromDays(1));
Microsoft.AspNetCore.SignalR.Client.Tests (1)
HttpConnectionFactoryTests.cs (1)
94{ $"{nameof(HttpConnectionOptions.CloseTimeout)}", TimeSpan.FromDays(1) },
Microsoft.AspNetCore.StaticFiles.Tests (2)
RangeHeaderTests.cs (2)
172req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.Subtract(TimeSpan.FromDays(1)).ToString("r")); 191req.Headers.Add("If-Range", original.Content.Headers.LastModified.Value.Subtract(TimeSpan.FromDays(1)).ToString("r"));
Microsoft.Build.Tasks.UnitTests (2)
GenerateBindingRedirects_Tests.cs (1)
293var oldTimestamp = DateTime.Now.Subtract(TimeSpan.FromDays(30));
ResourceHandling\GenerateResource_Tests.cs (1)
3920File.SetLastWriteTime(dll.Path, DateTime.Now - TimeSpan.FromDays(30));
Microsoft.Extensions.AI.Evaluation.Reporting (1)
Defaults.cs (1)
32public static TimeSpan DefaultTimeToLiveForCacheEntries { get; } = TimeSpan.FromDays(14);
Microsoft.Net.Http.Headers.Tests (8)
SetCookieHeaderValueTest.cs (8)
21MaxAge = TimeSpan.FromDays(1), 37MaxAge = TimeSpan.FromDays(1), 67MaxAge = TimeSpan.FromDays(-1), 73MaxAge = TimeSpan.FromDays(0), 138MaxAge = TimeSpan.FromDays(1), 152MaxAge = TimeSpan.FromDays(1), 241MaxAge = TimeSpan.FromDays(1), 252MaxAge = TimeSpan.FromDays(1),
MvcFormSample (1)
Models\Todo.cs (1)
9public DateTime DueDate { get; set; } = DateTime.Now.Add(TimeSpan.FromDays(1));
OutputCachingSample (1)
Startup.cs (1)
12options.AddBasePolicy(builder => builder.With(c => c.HttpContext.Request.Path.StartsWithSegments("/js")).Expire(TimeSpan.FromDays(1)));
PresentationCore.Tests (4)
System\Windows\Media\Animation\RepeatBehavior.Tests.cs (4)
162yield return new object[] { new RepeatBehavior(TimeSpan.FromDays(3)), new RepeatBehavior(TimeSpan.FromDays(3)), true }; 168yield return new object[] { new RepeatBehavior(TimeSpan.FromDays(5)), new RepeatBehavior(TimeSpan.FromDays(7)), false };