Skip to content

Commit

Permalink
build(deps): bump FluentAssertions from 6.10.0 to 6.11.0 in /src (#840)
Browse files Browse the repository at this point in the history
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Chris Pulman <[email protected]>
  • Loading branch information
dependabot[bot] and ChrisPulman authored Jun 28, 2023
1 parent 266caa3 commit 388fdf4
Show file tree
Hide file tree
Showing 13 changed files with 375 additions and 38 deletions.
7 changes: 2 additions & 5 deletions src/Akavache.Core/Akavache.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="MSBuild.Sdk.Extras">
<Project Sdk="MSBuild.Sdk.Extras">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;Xamarin.iOS10;Xamarin.Mac20;Xamarin.TVOS10;MonoAndroid12.0;MonoAndroid12.1;MonoAndroid13.0;tizen40;net6.0;net6.0-android;net6.0-ios;net6.0-tvos;net6.0-macos;net6.0-maccatalyst;net7.0;net7.0-android;net7.0-ios;net7.0-tvos;net7.0-macos;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);net462;net6.0-windows10.0.17763.0;net7.0-windows10.0.17763.0</TargetFrameworks>
Expand All @@ -14,6 +14,7 @@
<PackageReference Include="Newtonsoft.Json.Bson" Version="1.0.2" />
<PackageReference Include="System.Reactive" Version="6.0.0" />
<PackageReference Include="Splat" Version="14.*" />
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="7.0.1" />
</ItemGroup>

<ItemGroup>
Expand All @@ -30,10 +31,6 @@
<Compile Include="Platforms\shared-not-uwp\**\*.cs" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('net4')) ">
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="7.0.1" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('uap')) ">
<Compile Include="Platforms\uap\**\*.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Akavache;
/// </summary>
public class DefaultAkavacheHttpClientFactory : IAkavacheHttpClientFactory
{
private static ConcurrentDictionary<string, HttpClient> _instances = new();
private static readonly ConcurrentDictionary<string, HttpClient> _instances = new();

/// <inheritdoc/>
public HttpClient CreateClient(string name) => _instances.GetOrAdd(name, _ => new HttpClient());
Expand Down
6 changes: 0 additions & 6 deletions src/Akavache.Core/Platforms/shared/EncryptionProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

#if NET_461
using RxCrypt = System.Security.Cryptography;
#else
using RxCrypt = Akavache;
#endif

namespace Akavache
{
/// <summary>
Expand Down
6 changes: 6 additions & 0 deletions src/Akavache.Core/Platforms/shared/Registrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

#if ANDROID
using Android.App;
#if ANDROID33_0_OR_GREATER
using System.Runtime.Versioning;
#endif
#endif

namespace Akavache.Core
Expand All @@ -22,6 +25,9 @@ namespace Akavache.Core
public class Registrations : IWantsToRegisterStuff
{
/// <inheritdoc />
#if ANDROID && ANDROID33_0_OR_GREATER
[ObsoletedOSPlatform("android33.0")]
#endif
public void Register(IMutableDependencyResolver resolver, IReadonlyDependencyResolver readonlyDependencyResolver)
{
if (resolver is null)
Expand Down
2 changes: 1 addition & 1 deletion src/Akavache.Mobile/Akavache.Mobile.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="reactiveui" Version="18.*" />
<PackageReference Include="reactiveui" Version="19.*" />
</ItemGroup>

<ItemGroup>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/reactiveui/akavache")]
[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName=".NET Framework 4.6.2")]
namespace Akavache
{
public static class BitmapImageMixin
{
public static System.IObservable<Splat.IBitmap> LoadImage(this Akavache.IBlobCache blobCache, string key, float? desiredWidth = default, float? desiredHeight = default) { }
public static System.IObservable<Splat.IBitmap> LoadImageFromUrl(this Akavache.IBlobCache blobCache, string url, bool fetchAlways = false, float? desiredWidth = default, float? desiredHeight = default, System.DateTimeOffset? absoluteExpiration = default) { }
public static System.IObservable<Splat.IBitmap> LoadImageFromUrl(this Akavache.IBlobCache blobCache, System.Uri url, bool fetchAlways = false, float? desiredWidth = default, float? desiredHeight = default, System.DateTimeOffset? absoluteExpiration = default) { }
public static System.IObservable<Splat.IBitmap> LoadImageFromUrl(this Akavache.IBlobCache blobCache, string key, string url, bool fetchAlways = false, float? desiredWidth = default, float? desiredHeight = default, System.DateTimeOffset? absoluteExpiration = default) { }
public static System.IObservable<Splat.IBitmap> LoadImageFromUrl(this Akavache.IBlobCache blobCache, string key, System.Uri url, bool fetchAlways = false, float? desiredWidth = default, float? desiredHeight = default, System.DateTimeOffset? absoluteExpiration = default) { }
public static System.IObservable<byte[]> ThrowOnBadImageBuffer(byte[] compressedImage) { }
}
}
namespace Akavache.Drawing
{
public class Registrations
{
public Registrations() { }
public void Register(Splat.IMutableDependencyResolver resolver, Splat.IReadonlyDependencyResolver readonlyDependencyResolver) { }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[assembly: System.Reflection.AssemblyMetadata("RepositoryUrl", "https://github.com/reactiveui/akavache")]
[assembly: System.Runtime.Versioning.TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName=".NET Framework 4.6.2")]
namespace Akavache
{
public class Registrations
{
public Registrations() { }
public void Register(Splat.IMutableDependencyResolver resolver, Splat.IReadonlyDependencyResolver readonlyDependencyResolver) { }
public static void Start(string applicationName) { }
}
}
namespace Akavache.Sqlite3
{
public static class LinkerPreserve { }
public class SQLitePersistentBlobCache : Akavache.Sqlite3.SqlRawPersistentBlobCache
{
public SQLitePersistentBlobCache(string databaseFile, System.Reactive.Concurrency.IScheduler? scheduler = null) { }
}
}
14 changes: 9 additions & 5 deletions src/Akavache.Tests/Akavache.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="MSBuild.Sdk.Extras">
<Project Sdk="MSBuild.Sdk.Extras">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
Expand All @@ -7,19 +7,23 @@
<Nullable>disable</Nullable>
</PropertyGroup>

<ItemGroup Condition="$(TargetFramework.StartsWith('net4'))">
<PackageReference Include="IndexRange" Version="1.0.2" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="Microsoft.Reactive.Testing" Version="6.0.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.console" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />
<PackageReference Include="Xunit.StaFact" Version="1.1.11" />
<PackageReference Include="ReactiveUI.Testing" Version="18.*" />
<PackageReference Include="ReactiveUI.Testing" Version="19.*" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="2.1.5" />
<PackageReference Include="FluentAssertions" Version="6.10.0" />
<PackageReference Include="DiffEngine" Version="11.4.0" />
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="DiffEngine" Version="11.4.1" />
<PackageReference Include="PublicApiGenerator" Version="11.0.0" />
<PackageReference Include="coverlet.msbuild" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
Expand Down
3 changes: 2 additions & 1 deletion src/Akavache.Tests/BasicEncryptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class BasicEncryptionTests
[SkippableFact]
public async Task ShouldEncrypt()
{
// TODO: This test is failing on .NET 6.0. Investigate.
Skip.IfNot(GetType().Assembly.GetTargetFrameworkName().StartsWith("net4"));

var provider = new EncryptionProvider();
Expand Down Expand Up @@ -51,4 +52,4 @@ public async Task ShouldDecrypt()
}

private static async Task<byte[]> AsArray(IObservable<byte[]> source) => await source.FirstAsync();
}
}
39 changes: 23 additions & 16 deletions src/Akavache.Tests/TestBases/BlobCacheExtensionsTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using Microsoft.Reactive.Testing;

using ReactiveUI.Testing;

using Splat;
using Xunit;

namespace Akavache.Tests;
Expand All @@ -31,7 +31,7 @@ public async Task DownloadUrlTest()
using (var fixture = CreateBlobCache(path))
{
var bytes = await fixture.DownloadUrl("http://httpbin.org/html").FirstAsync();
Assert.True(bytes.Length > 0);
bytes.Length.Should().BeGreaterThan(0);
}
}

Expand All @@ -46,7 +46,7 @@ public async Task DownloadUriTest()
using (var fixture = CreateBlobCache(path))
{
var bytes = await fixture.DownloadUrl(new Uri("http://httpbin.org/html")).FirstAsync();
Assert.True(bytes.Length > 0);
bytes.Length.Should().BeGreaterThan(0);
}
}

Expand All @@ -63,7 +63,7 @@ public async Task DownloadUrlWithKeyTest()
var key = Guid.NewGuid().ToString();
await fixture.DownloadUrl(key, "http://httpbin.org/html").FirstAsync();
var bytes = await fixture.Get(key);
Assert.True(bytes.Length > 0);
bytes.Length.Should().BeGreaterThan(0);
}
}

Expand All @@ -78,9 +78,9 @@ public async Task DownloadUriWithKeyTest()
using (var fixture = CreateBlobCache(path))
{
var key = Guid.NewGuid().ToString();
await fixture.DownloadUrl(key, new Uri("http://httpbin.org/html")).FirstAsync();
await fixture.DownloadUrl(key, new Uri("https://httpbin.org/html")).FirstAsync();
var bytes = await fixture.Get(key);
Assert.True(bytes.Length > 0);
bytes.Length.Should().BeGreaterThan(0);
}
}

Expand Down Expand Up @@ -170,9 +170,9 @@ public async Task ArraysShouldBeRoundtrippable()
}
}

Assert.Equal(input.First().Blog, result.First().Blog);
Assert.Equal(input.First().Bio, result.First().Bio);
Assert.Equal(input.First().Name, result.First().Name);
Assert.Equal(input[0].Blog, result[0].Blog);
Assert.Equal(input[0].Bio, result[0].Bio);
Assert.Equal(input[0].Name, result[0].Name);
Assert.Equal(input.Last().Blog, result.Last().Blog);
Assert.Equal(input.Last().Bio, result.Last().Bio);
Assert.Equal(input.Last().Name, result.Last().Name);
Expand Down Expand Up @@ -237,8 +237,8 @@ public async Task ArraysShouldBeRoundtrippableUsingObjectFactory()
}
}

Assert.Equal(input.First().Age, result.First().Age);
Assert.Equal(input.First().Name, result.First().Name);
Assert.Equal(input[0].Age, result[0].Age);
Assert.Equal(input[0].Name, result[0].Name);
Assert.Equal(input.Last().Age, result.Last().Age);
Assert.Equal(input.Last().Name, result.Last().Name);
}
Expand All @@ -247,9 +247,12 @@ public async Task ArraysShouldBeRoundtrippableUsingObjectFactory()
/// Make sure that the fetch functions are called only once for the get or fetch object methods.
/// </summary>
/// <returns>A task to monitor the progress.</returns>
[Fact(Skip = "Failing at the moment. Fix later.")]
[SkippableFact]
public async Task FetchFunctionShouldBeCalledOnceForGetOrFetchObject()
{
// TODO: This test is failing on .NET 6.0. Investigate.
Skip.IfNot(GetType().Assembly.GetTargetFrameworkName().StartsWith("net4"));

var fetchCount = 0;
var fetcher = new Func<IObservable<Tuple<string, string>>>(() =>
{
Expand Down Expand Up @@ -292,10 +295,12 @@ public async Task FetchFunctionShouldBeCalledOnceForGetOrFetchObject()
/// <summary>
/// Makes sure the fetch function debounces current requests.
/// </summary>
[Fact(Skip = "TestScheduler tests aren't gonna work with new SQLite")]
[SkippableFact]
public void FetchFunctionShouldDebounceConcurrentRequests() =>
new TestScheduler().With(sched =>
{
// TODO: TestScheduler tests aren't gonna work with new SQLite.
Skip.IfNot(GetType().Assembly.GetTargetFrameworkName().StartsWith("net4"));
using (Utility.WithEmptyDirectory(out var path))
{
var callCount = 0;
Expand Down Expand Up @@ -424,10 +429,12 @@ public async Task FetchFunctionShouldPropagateObservedExceptionAsObservableExcep
/// <summary>
/// Make sure that the GetOrFetch function respects expirations.
/// </summary>
[Fact(Skip = "TestScheduler tests aren't gonna work with new SQLite")]
[SkippableFact]
public void GetOrFetchShouldRespectExpiration() =>
new TestScheduler().With(sched =>
{
// TODO: TestScheduler tests aren't gonna work with new SQLite.
Skip.IfNot(GetType().Assembly.GetTargetFrameworkName().StartsWith("net4"));
using (Utility.WithEmptyDirectory(out var path))
{
var fixture = CreateBlobCache(path);
Expand Down Expand Up @@ -510,7 +517,7 @@ public async Task GetAndFetchLatestCallsFetchPredicate()
{
var fetchPredicateCalled = false;

bool FetchPredicate(DateTimeOffset d)
bool FetchPredicate(DateTimeOffset _)
{
fetchPredicateCalled = true;

Expand Down Expand Up @@ -573,7 +580,7 @@ public async Task GetAndFetchLatestValidatesItemsToBeCached()
// GetAndFetchLatest skips cache invalidation/storage due to cache validation predicate.
await fixture.InsertObject(key, items);

await fixture.GetAndFetchLatest(key, fetcher, cacheValidationPredicate: i => i is not null && i.Count > 0).LastAsync();
await fixture.GetAndFetchLatest(key, fetcher, cacheValidationPredicate: i => i?.Count > 0).LastAsync();

var result = await fixture.GetObject<List<int>>(key).FirstAsync();

Expand Down
8 changes: 5 additions & 3 deletions src/Akavache.Tests/TestBases/BlobCacheInterfaceTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Microsoft.Reactive.Testing;

using ReactiveUI.Testing;

using Splat;
using Xunit;

namespace Akavache.Tests;
Expand Down Expand Up @@ -138,9 +138,11 @@ public async Task InsertingAnItemTwiceShouldAlwaysGetTheNewOne()
/// <summary>
/// Checks to make sure that the cache respects expiration dates.
/// </summary>
[Fact(Skip = "TestScheduler tests aren't gonna work with new SQLite")]
[SkippableFact]
public void CacheShouldRespectExpiration()
{
// TODO: TestScheduler tests aren't gonna work with new SQLite.
Skip.IfNot(GetType().Assembly.GetTargetFrameworkName().StartsWith("net4"));
using (Utility.WithEmptyDirectory(out var path))
{
new TestScheduler().With(sched =>
Expand Down Expand Up @@ -353,4 +355,4 @@ public async Task VacuumPurgeEntriesThatAreExpired()
/// <param name="path">The path to the blob cache.</param>
/// <returns>The blob cache for testing.</returns>
protected abstract IBlobCache CreateBlobCache(string path);
}
}
1 change: 1 addition & 0 deletions src/Directory.build.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<AnalysisLevel>latest</AnalysisLevel>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<NoWarn>IDE1006;SA1313;</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 388fdf4

Please sign in to comment.