diff --git a/samples/Thinktecture.Runtime.Extensions.Samples/SmartEnums/SmartEnumDemos.cs b/samples/Thinktecture.Runtime.Extensions.Samples/SmartEnums/SmartEnumDemos.cs index 56075559..dd7d626c 100644 --- a/samples/Thinktecture.Runtime.Extensions.Samples/SmartEnums/SmartEnumDemos.cs +++ b/samples/Thinktecture.Runtime.Extensions.Samples/SmartEnums/SmartEnumDemos.cs @@ -136,18 +136,18 @@ private static void DemoForNonValidatableEnum(ILogger logger) var returnValue = productType.Switch(ProductType.Groceries, static () => "Switch with Func: Groceries", ProductType.Housewares, static () => "Switch with Func: Housewares"); - logger.Information(returnValue); + logger.Information("{ReturnValue}", returnValue); returnValue = productType.Switch(logger, ProductType.Groceries, static _ => "Switch with Func: Groceries", ProductType.Housewares, static _ => "Switch with Func: Housewares"); - logger.Information(returnValue); + logger.Information("{ReturnValue}", returnValue); returnValue = productType.Map(ProductType.Groceries, "Map: Groceries", ProductType.Housewares, "Map: Housewares"); - logger.Information(returnValue); + logger.Information("{ReturnValue}", returnValue); var parsed = ProductType.TryParse("Groceries", null, out var parsedProductType); logger.Information("Success: {Success} Parsed: {Parsed}", parsed, parsedProductType); diff --git a/src/Thinktecture.Runtime.Extensions.MessagePack/Formatters/StructValueObjectMessagePackFormatter.cs b/src/Thinktecture.Runtime.Extensions.MessagePack/Formatters/StructValueObjectMessagePackFormatter.cs index 618cc8c5..26a39e66 100644 --- a/src/Thinktecture.Runtime.Extensions.MessagePack/Formatters/StructValueObjectMessagePackFormatter.cs +++ b/src/Thinktecture.Runtime.Extensions.MessagePack/Formatters/StructValueObjectMessagePackFormatter.cs @@ -65,7 +65,7 @@ private static bool TryReadKey( return false; } - var formatter = options.Resolver.GetFormatterWithVerify(); + var formatter = options.Resolver.GetFormatterWithVerify(); key = formatter.Deserialize(ref reader, options); return key is not null; diff --git a/src/Thinktecture.Runtime.Extensions.MessagePack/Formatters/ValueObjectMessagePackFormatter.cs b/src/Thinktecture.Runtime.Extensions.MessagePack/Formatters/ValueObjectMessagePackFormatter.cs index 9ddda59c..bcef5bfe 100644 --- a/src/Thinktecture.Runtime.Extensions.MessagePack/Formatters/ValueObjectMessagePackFormatter.cs +++ b/src/Thinktecture.Runtime.Extensions.MessagePack/Formatters/ValueObjectMessagePackFormatter.cs @@ -35,7 +35,7 @@ public void Serialize(ref MessagePackWriter writer, T? value, MessagePackSeriali if (reader.TryReadNil()) return default; - var formatter = options.Resolver.GetFormatterWithVerify(); + var formatter = options.Resolver.GetFormatterWithVerify(); var key = formatter.Deserialize(ref reader, options); if (key is null) diff --git a/test/Thinktecture.Runtime.Extensions.Tests/ReadOnlyCollectionExtensions/ToReadOnlyCollection.cs b/test/Thinktecture.Runtime.Extensions.Tests/ReadOnlyCollectionExtensions/ToReadOnlyCollection.cs index f89fefbd..9058c41f 100644 --- a/test/Thinktecture.Runtime.Extensions.Tests/ReadOnlyCollectionExtensions/ToReadOnlyCollection.cs +++ b/test/Thinktecture.Runtime.Extensions.Tests/ReadOnlyCollectionExtensions/ToReadOnlyCollection.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Linq; +#nullable enable + namespace Thinktecture.Runtime.Tests.ReadOnlyCollectionExtensions; public class ToReadOnlyCollection @@ -10,14 +12,14 @@ public class ToReadOnlyCollection [Fact] public void Should_throw_if_items_is_null() { - 0.Invoking(_ => ((IReadOnlyCollection)null)!.ToReadOnlyCollection(i => _)) - .Should().Throw(); + FluentActions.Invoking(() => ((IReadOnlyCollection)null!).ToReadOnlyCollection(i => i)) + .Should().Throw(); } [Fact] public void Should_throw_if_count_is_negative() { - Array.Empty().Invoking(e => e.ToReadOnlyCollection((Func)null)) + Array.Empty().Invoking(e => e.ToReadOnlyCollection((Func?)null!)) .Should().Throw(); }