Skip to content

Commit

Permalink
fix: Nullability fix (#162)
Browse files Browse the repository at this point in the history
* fix: Nullability fixes

* build(deps): update Splat requirement from 10.* to 11.* in /src

Updates the requirements on [Splat](https://github.com/reactiveui/splat) to permit the latest version.
- [Release notes](https://github.com/reactiveui/splat/releases)
- [Changelog](https://github.com/reactiveui/splat/blob/main/RELEASENOTES.md)
- [Commits](reactiveui/splat@10.0.1...11.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

* Add a smoke test

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
worldbeater and dependabot[bot] committed Apr 10, 2021
1 parent 8441b97 commit ba17bac
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 135 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

30 changes: 30 additions & 0 deletions src/Fusillade.Tests/NetCacheTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright (c) 2021 .NET Foundation and Contributors. All rights reserved.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

using Xunit;

namespace Fusillade.Tests
{
/// <summary>
/// Checks to make sure that the NetCache operates correctly.
/// </summary>
[CollectionDefinition(nameof(NetCacheTests), DisableParallelization = true)]
public class NetCacheTests
{
/// <summary>
/// Verifies that we are registering the default handlers correctly.
/// </summary>
[Fact]
public void DefaultValuesShouldBeRegistered()
{
Assert.NotNull(NetCache.Speculative);
Assert.NotNull(NetCache.UserInitiated);
Assert.NotNull(NetCache.Background);
Assert.NotNull(NetCache.Offline);
Assert.NotNull(NetCache.OperationQueue);
Assert.Null(NetCache.RequestCache);
}
}
}
2 changes: 1 addition & 1 deletion src/Fusillade/Fusillade.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ItemGroup>
<PackageReference Include="punchclock" Version="3.*" />
<PackageReference Include="Splat" Version="10.*" />
<PackageReference Include="Splat" Version="11.*" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Reactive" Version="5.*" />
</ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions src/Fusillade/NetCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static NetCache()
/// </summary>
public static LimitingHttpMessageHandler Speculative
{
get => unitTestSpeculative ?? speculative ?? Locator.Current.GetService<LimitingHttpMessageHandler>("Speculative");
get => unitTestSpeculative ?? Locator.Current.GetService<LimitingHttpMessageHandler>("Speculative") ?? speculative;
set
{
if (ModeDetector.InUnitTestRunner())
Expand All @@ -81,7 +81,7 @@ public static LimitingHttpMessageHandler Speculative
/// </summary>
public static HttpMessageHandler UserInitiated
{
get => unitTestUserInitiated ?? userInitiated ?? Locator.Current.GetService<HttpMessageHandler>("UserInitiated");
get => unitTestUserInitiated ?? Locator.Current.GetService<HttpMessageHandler>("UserInitiated") ?? userInitiated;
set
{
if (ModeDetector.InUnitTestRunner())
Expand All @@ -102,7 +102,7 @@ public static HttpMessageHandler UserInitiated
/// </summary>
public static HttpMessageHandler Background
{
get => unitTestBackground ?? background ?? Locator.Current.GetService<HttpMessageHandler>("Background");
get => unitTestBackground ?? Locator.Current.GetService<HttpMessageHandler>("Background") ?? background;
set
{
if (ModeDetector.InUnitTestRunner())
Expand All @@ -123,7 +123,7 @@ public static HttpMessageHandler Background
/// </summary>
public static HttpMessageHandler Offline
{
get => unitTestOffline ?? offline ?? Locator.Current.GetService<HttpMessageHandler>("Offline");
get => unitTestOffline ?? Locator.Current.GetService<HttpMessageHandler>("Offline") ?? offline;
set
{
if (ModeDetector.InUnitTestRunner())
Expand All @@ -145,7 +145,7 @@ public static HttpMessageHandler Offline
/// </summary>
public static OperationQueue OperationQueue
{
get => unitTestOperationQueue ?? operationQueue ?? Locator.Current.GetService<OperationQueue>("OperationQueue");
get => unitTestOperationQueue ?? Locator.Current.GetService<OperationQueue>("OperationQueue") ?? operationQueue;
set
{
if (ModeDetector.InUnitTestRunner())
Expand Down

0 comments on commit ba17bac

Please sign in to comment.