-
Notifications
You must be signed in to change notification settings - Fork 729
/
FakeHostOptions.cs
59 lines (50 loc) · 2.04 KB
/
FakeHostOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using Microsoft.Extensions.DependencyInjection;
namespace Microsoft.Extensions.Hosting.Testing;
/// <summary>
/// Options to configure <see cref="FakeHost"/>.
/// </summary>
public class FakeHostOptions
{
/// <summary>
/// Gets or sets the time limit for the host to start.
/// </summary>
/// <value>The default value is 5 seconds.</value>
/// <remarks>This limit is used if there's no cancellation token.</remarks>
public TimeSpan StartUpTimeout { get; set; } = TimeSpan.FromSeconds(5);
/// <summary>
/// Gets or sets the time limit for the host to shut down.
/// </summary>
/// <value>The default value is 10 seconds.</value>
/// <remarks>This limit is used if there's no cancellation token.</remarks>
public TimeSpan ShutDownTimeout { get; set; } = TimeSpan.FromSeconds(10);
/// <summary>
/// Gets or sets the time limit for the host to be up.
/// </summary>
/// <value>The default is 30 seconds.</value>
/// <remarks>
/// -1 millisecond means infinite time to live.
/// TimeToLive is not enforced when debugging.
/// </remarks>
public TimeSpan TimeToLive { get; set; } = TimeSpan.FromSeconds(30);
/// <summary>
/// Gets or sets a value indicating whether fake logging is configured automatically.
/// </summary>
/// <value>
/// The default value is <see langword="true"/>.
/// </value>
public bool FakeLogging { get; set; } = true;
/// <inheritdoc cref="ServiceProviderOptions"/>
public bool ValidateScopes { get; set; } = true;
/// <inheritdoc cref="ServiceProviderOptions"/>
public bool ValidateOnBuild { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating whether fake redaction is configured automatically.
/// </summary>
/// <value>
/// The default value is <see langword="true"/>.
/// </value>
public bool FakeRedaction { get; set; } = true;
}