-
-
Notifications
You must be signed in to change notification settings - Fork 125
Expand file tree
/
Copy pathInterface_With_Static_Abstract_Members.verified.txt
More file actions
139 lines (117 loc) · 5.5 KB
/
Interface_With_Static_Abstract_Members.verified.txt
File metadata and controls
139 lines (117 loc) · 5.5 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// <auto-generated/>
#nullable enable
namespace TUnit.Mocks.Generated
{
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public interface IServiceFactory_Mockable : global::IServiceFactory
{
static global::ClientConfig global::IServiceFactory.CreateDefaultConfig()
{
var __engine = IServiceFactory_StaticEngine.Engine;
if (__engine is null) return default!;
var __result = __engine.HandleCallWithReturn<global::ClientConfig>(1, "CreateDefaultConfig", global::System.Array.Empty<object?>(), default!);
return __result;
}
static string global::IServiceFactory.ServiceId
{
get
{
var __engine = IServiceFactory_StaticEngine.Engine;
if (__engine is null) return default!;
return __engine.HandleCallWithReturn<string>(2, "get_ServiceId", global::System.Array.Empty<object?>(), "");
}
set
{
var __engine = IServiceFactory_StaticEngine.Engine;
if (__engine is null) return;
__engine.HandleCall(3, "set_ServiceId", new object?[] { value });
}
}
}
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal static class IServiceFactory_StaticEngine
{
private static readonly global::System.Threading.AsyncLocal<global::TUnit.Mocks.IMockEngineAccess?> _engine = new();
internal static global::TUnit.Mocks.IMockEngineAccess? Engine
{
get => _engine.Value;
set => _engine.Value = value;
}
}
}
// ===== FILE SEPARATOR =====
// <auto-generated/>
#nullable enable
namespace TUnit.Mocks.Generated
{
internal static class IServiceFactory_MockFactory
{
[global::System.Runtime.CompilerServices.ModuleInitializer]
internal static void Register()
{
global::TUnit.Mocks.Mock.RegisterFactory<global::TUnit.Mocks.Generated.IServiceFactory_Mockable>(Create);
}
private static global::TUnit.Mocks.Mock<global::TUnit.Mocks.Generated.IServiceFactory_Mockable> Create(global::TUnit.Mocks.MockBehavior behavior)
{
var engine = new global::TUnit.Mocks.MockEngine<global::TUnit.Mocks.Generated.IServiceFactory_Mockable>(behavior);
var impl = new IServiceFactory_MockImpl(engine);
engine.Raisable = impl;
var mock = new global::TUnit.Mocks.Mock<global::TUnit.Mocks.Generated.IServiceFactory_Mockable>(impl, engine);
return mock;
}
}
}
// ===== FILE SEPARATOR =====
// <auto-generated/>
#nullable enable
namespace TUnit.Mocks.Generated
{
internal sealed class IServiceFactory_MockImpl : global::TUnit.Mocks.Generated.IServiceFactory_Mockable, global::TUnit.Mocks.IRaisable
{
private readonly global::TUnit.Mocks.MockEngine<global::TUnit.Mocks.Generated.IServiceFactory_Mockable> _engine;
internal IServiceFactory_MockImpl(global::TUnit.Mocks.MockEngine<global::TUnit.Mocks.Generated.IServiceFactory_Mockable> engine)
{
_engine = engine;
if (IServiceFactory_StaticEngine.Engine is not null)
{
throw new global::System.InvalidOperationException(
"Multiple mocks of an interface with static abstract members cannot be created in the same test context. " +
"Static member calls are routed via a shared AsyncLocal engine, so only one mock instance per type is supported per test.");
}
IServiceFactory_StaticEngine.Engine = engine;
}
public string GetName()
{
return _engine.HandleCallWithReturn<string>(0, "GetName", global::System.Array.Empty<object?>(), "");
}
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public void RaiseEvent(string eventName, object? args)
{
throw new global::System.InvalidOperationException($"No event named '{eventName}' exists on this mock.");
}
}
}
// ===== FILE SEPARATOR =====
// <auto-generated/>
#nullable enable
namespace TUnit.Mocks.Generated
{
public static class IServiceFactory_MockMemberExtensions
{
public static global::TUnit.Mocks.MockMethodCall<string> GetName(this global::TUnit.Mocks.Mock<global::TUnit.Mocks.Generated.IServiceFactory_Mockable> mock)
{
var matchers = global::System.Array.Empty<global::TUnit.Mocks.Arguments.IArgumentMatcher>();
return new global::TUnit.Mocks.MockMethodCall<string>(global::TUnit.Mocks.Mock.GetEngine(mock), 0, "GetName", matchers);
}
public static global::TUnit.Mocks.MockMethodCall<global::ClientConfig> CreateDefaultConfig(this global::TUnit.Mocks.Mock<global::TUnit.Mocks.Generated.IServiceFactory_Mockable> mock)
{
var matchers = global::System.Array.Empty<global::TUnit.Mocks.Arguments.IArgumentMatcher>();
return new global::TUnit.Mocks.MockMethodCall<global::ClientConfig>(global::TUnit.Mocks.Mock.GetEngine(mock), 1, "CreateDefaultConfig", matchers);
}
extension(global::TUnit.Mocks.Mock<global::TUnit.Mocks.Generated.IServiceFactory_Mockable> mock)
{
public global::TUnit.Mocks.PropertyMockCall<string> ServiceId
=> new(global::TUnit.Mocks.Mock.GetEngine(mock), 2, 3, "ServiceId", true, true);
}
}
}