Skip to content

Commit 67d3e78

Browse files
authored
chore: Update SplatVersion from 18.1.1 to 19.1.1 (#4260)
This pull request updates the version of the `Splat` package used in the project, ensuring that the codebase benefits from the latest features and fixes. - Dependency updates: * Bumped the `Splat` package version from `18.1.1` to `19.1.1` in `src/Directory.Packages.props`.
1 parent 0044f6c commit 67d3e78

File tree

4 files changed

+156
-10
lines changed

4 files changed

+156
-10
lines changed

.claude/settings.local.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(dotnet test:*)",
5+
"Bash(Select-String -Pattern \"failed|Failed|error|Error\" -Context 2,5)",
6+
"Bash(Select-Object -First 50)",
7+
"Bash(dotnet build:*)",
8+
"Bash(find:*)",
9+
"Bash(grep:*)"
10+
]
11+
}
12+
}

src/Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
55
</PropertyGroup>
66
<PropertyGroup>
7-
<SplatVersion>18.1.1</SplatVersion>
7+
<SplatVersion>19.1.1</SplatVersion>
88
<XamarinAndroidXCoreVersion>1.17.0</XamarinAndroidXCoreVersion>
99
<XamarinAndroidXLifecycleLiveDataVersion>2.9.2.1</XamarinAndroidXLifecycleLiveDataVersion>
1010
<MauiVersion Condition="$(TargetFramework.StartsWith('net10'))">10.0.0</MauiVersion>

src/tests/ReactiveUI.Builder.Tests/Mixins/BuilderInstanceMixinsHappyPathTests.cs

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ public MockDependencyResolver(params object[] services)
11141114
}
11151115
}
11161116

1117-
public object? GetService(Type? serviceType, string? contract = null)
1117+
public object? GetService(Type? serviceType)
11181118
{
11191119
if (serviceType == null)
11201120
{
@@ -1124,7 +1124,31 @@ public MockDependencyResolver(params object[] services)
11241124
return _services.TryGetValue(serviceType, out var service) ? service : null;
11251125
}
11261126

1127-
public IEnumerable<object> GetServices(Type? serviceType, string? contract = null)
1127+
public object? GetService(Type? serviceType, string? contract)
1128+
{
1129+
if (serviceType == null)
1130+
{
1131+
return null;
1132+
}
1133+
1134+
return _services.TryGetValue(serviceType, out var service) ? service : null;
1135+
}
1136+
1137+
public T? GetService<T>() => (T?)GetService(typeof(T));
1138+
1139+
public T? GetService<T>(string? contract) => (T?)GetService(typeof(T), contract);
1140+
1141+
public IEnumerable<object> GetServices(Type? serviceType)
1142+
{
1143+
if (serviceType == null)
1144+
{
1145+
return [];
1146+
}
1147+
1148+
return _services.TryGetValue(serviceType, out var service) ? [service] : [];
1149+
}
1150+
1151+
public IEnumerable<object> GetServices(Type? serviceType, string? contract)
11281152
{
11291153
if (serviceType == null)
11301154
{
@@ -1134,9 +1158,17 @@ public IEnumerable<object> GetServices(Type? serviceType, string? contract = nul
11341158
return _services.TryGetValue(serviceType, out var service) ? [service] : [];
11351159
}
11361160

1137-
public bool HasRegistration(Type? serviceType, string? contract = null) =>
1161+
public IEnumerable<T> GetServices<T>() => GetServices(typeof(T)).OfType<T>();
1162+
1163+
public IEnumerable<T> GetServices<T>(string? contract) => GetServices(typeof(T), contract).OfType<T>();
1164+
1165+
public bool HasRegistration(Type? serviceType, string? contract) =>
11381166
serviceType != null && _services.ContainsKey(serviceType);
11391167

1168+
public bool HasRegistration<T>() => HasRegistration(typeof(T), null);
1169+
1170+
public bool HasRegistration<T>(string? contract) => HasRegistration(typeof(T), contract);
1171+
11401172
public void Dispose()
11411173
{
11421174
GC.SuppressFinalize(this);

src/tests/ReactiveUI.Tests/RxAppBuilderTest.cs

Lines changed: 108 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,24 +58,126 @@ await Assert.That(() => resolver.CreateReactiveUIBuilder())
5858
/// </summary>
5959
private class TestResolver : IMutableDependencyResolver, IReadonlyDependencyResolver
6060
{
61-
public object? GetService(Type? serviceType, string? contract = null) => null;
61+
public object? GetService(Type? serviceType) => null;
6262

63-
public IEnumerable<object> GetServices(Type? serviceType, string? contract = null) => [];
63+
public object? GetService(Type? serviceType, string? contract) => null;
6464

65-
public bool HasRegistration(Type? serviceType, string? contract = null) => false;
65+
public T? GetService<T>() => default;
6666

67-
public void Register(Func<object?> factory, Type? serviceType, string? contract = null)
67+
public T? GetService<T>(string? contract) => default;
68+
69+
public IEnumerable<object> GetServices(Type? serviceType) => [];
70+
71+
public IEnumerable<object> GetServices(Type? serviceType, string? contract) => [];
72+
73+
public IEnumerable<T> GetServices<T>() => [];
74+
75+
public IEnumerable<T> GetServices<T>(string? contract) => [];
76+
77+
public bool HasRegistration(Type? serviceType) => false;
78+
79+
public bool HasRegistration(Type? serviceType, string? contract) => false;
80+
81+
public bool HasRegistration<T>() => false;
82+
83+
public bool HasRegistration<T>(string? contract) => false;
84+
85+
public void Register(Func<object?> factory, Type? serviceType)
86+
{
87+
}
88+
89+
public void Register(Func<object?> factory, Type? serviceType, string? contract)
90+
{
91+
}
92+
93+
public void Register<T>(Func<T?> factory)
94+
{
95+
}
96+
97+
public void Register<T>(Func<T?> factory, string? contract)
98+
{
99+
}
100+
101+
public void Register<TService, TImplementation>()
102+
where TService : class
103+
where TImplementation : class, TService, new()
104+
{
105+
}
106+
107+
public void Register<TService, TImplementation>(string? contract)
108+
where TService : class
109+
where TImplementation : class, TService, new()
68110
{
69111
}
70112

71-
public void UnregisterCurrent(Type? serviceType, string? contract = null)
113+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Interface implementation")]
114+
public void RegisterConstant(object? value, Type? serviceType, string? contract)
72115
{
73116
}
74117

75-
public void UnregisterAll(Type? serviceType, string? contract = null)
118+
public void RegisterConstant<T>(T? value)
119+
where T : class
76120
{
77121
}
78122

123+
public void RegisterConstant<T>(T? value, string? contract)
124+
where T : class
125+
{
126+
}
127+
128+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Interface implementation")]
129+
public void RegisterLazySingleton(Func<object?> factory, Type? serviceType, string? contract)
130+
{
131+
}
132+
133+
public void RegisterLazySingleton<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] T>(Func<T?> factory)
134+
where T : class
135+
{
136+
}
137+
138+
public void RegisterLazySingleton<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] T>(Func<T?> factory, string? contract)
139+
where T : class
140+
{
141+
}
142+
143+
public void UnregisterCurrent(Type? serviceType)
144+
{
145+
}
146+
147+
public void UnregisterCurrent(Type? serviceType, string? contract)
148+
{
149+
}
150+
151+
public void UnregisterCurrent<T>()
152+
{
153+
}
154+
155+
public void UnregisterCurrent<T>(string? contract)
156+
{
157+
}
158+
159+
public void UnregisterAll(Type? serviceType)
160+
{
161+
}
162+
163+
public void UnregisterAll(Type? serviceType, string? contract)
164+
{
165+
}
166+
167+
public void UnregisterAll<T>()
168+
{
169+
}
170+
171+
public void UnregisterAll<T>(string? contract)
172+
{
173+
}
174+
175+
public IDisposable ServiceRegistrationCallback(Type serviceType, Action<IDisposable> callback) => Disposable.Empty;
176+
79177
public IDisposable ServiceRegistrationCallback(Type serviceType, string? contract, Action<IDisposable> callback) => Disposable.Empty;
178+
179+
public IDisposable ServiceRegistrationCallback<T>(Action<IDisposable> callback) => Disposable.Empty;
180+
181+
public IDisposable ServiceRegistrationCallback<T>(string? contract, Action<IDisposable> callback) => Disposable.Empty;
80182
}
81183
}

0 commit comments

Comments
 (0)