10 instantiations of LazyValue
Microsoft.AspNetCore.Razor.Utilities.Shared.UnitTests (10)
Threading\LazyValueTests.cs (10)
21
var lazy = new
LazyValue
<string>(() =>
44
var lazy = new
LazyValue
<object>(() => expectedValue);
57
var lazy = new
LazyValue
<int>(() => 42);
70
var lazy = new
LazyValue
<string?>(() => null);
84
var lazy = new
LazyValue
<string>(() => throw expectedException);
96
var lazy = new
LazyValue
<string>(() =>
122
var lazy = new
LazyValue
<string>(() =>
158
var lazy = new
LazyValue
<int>(() => Interlocked.Increment(ref callCount));
436
var lazy = new
LazyValue
<byte[]>(() => new byte[1024 * 1024]); // 1MB array
468
var lazy = new
LazyValue
<string>(() => $"Factory with {capturedValue}");
12 references to LazyValue
Microsoft.AspNetCore.Razor.Utilities.Shared (2)
Threading\LazyValue`1.cs (2)
15
/// <see cref="
LazyValue
{T}"/> implements a thread-safe lazy initialization pattern that guarantees
42
/// Initializes a new instance of the <see cref="
LazyValue
{T}"/> struct with the specified factory function.
Microsoft.AspNetCore.Razor.Utilities.Shared.UnitTests (10)
Threading\LazyValueTests.cs (10)
21
var
lazy = new LazyValue<string>(() =>
44
var
lazy = new LazyValue<object>(() => expectedValue);
57
var
lazy = new LazyValue<int>(() => 42);
70
var
lazy = new LazyValue<string?>(() => null);
84
var
lazy = new LazyValue<string>(() => throw expectedException);
96
var
lazy = new LazyValue<string>(() =>
122
var
lazy = new LazyValue<string>(() =>
158
var
lazy = new LazyValue<int>(() => Interlocked.Increment(ref callCount));
436
var
lazy = new LazyValue<byte[]>(() => new byte[1024 * 1024]); // 1MB array
468
var
lazy = new LazyValue<string>(() => $"Factory with {capturedValue}");