diff --git a/Pipeline/Build.MutationTests.cs b/Pipeline/Build.MutationTests.cs index a83cd765d..f646ff4d8 100644 --- a/Pipeline/Build.MutationTests.cs +++ b/Pipeline/Build.MutationTests.cs @@ -150,7 +150,6 @@ private void ExecuteMutationTest(Project project, Project[] testProjects) DotNetToolInstall(_ => _ .SetPackageName("dotnet-stryker") - .SetVersion("4.7.0") .SetToolInstallationPath(toolPath)); string branchName = BranchName; diff --git a/Source/aweXpect.Core/Core/Nodes/AsyncMappingNode.cs b/Source/aweXpect.Core/Core/Nodes/AsyncMappingNode.cs index b7d70a621..3029a5e46 100644 --- a/Source/aweXpect.Core/Core/Nodes/AsyncMappingNode.cs +++ b/Source/aweXpect.Core/Core/Nodes/AsyncMappingNode.cs @@ -43,16 +43,16 @@ public override async Task IsMetBy( return result.Fail("it was ", value); } - if (value is not TSource typedValue) + if (value is TSource typedValue) { - throw new InvalidOperationException( - $"The member type for the actual value in the which node did not match.{Environment.NewLine}Expected: {Formatter.Format(typeof(TSource))},{Environment.NewLine} Found: {Formatter.Format(value.GetType())}") - .LogTrace(); + TTarget matchingValue = await _memberAccessor.AccessMember(typedValue); + ConstraintResult memberResult = await base.IsMetBy(matchingValue, context, cancellationToken); + return memberResult.UseValue(value); } - TTarget matchingValue = await _memberAccessor.AccessMember(typedValue); - ConstraintResult memberResult = await base.IsMetBy(matchingValue, context, cancellationToken); - return memberResult.UseValue(value); + throw new InvalidOperationException( + $"The member type for the actual value in the which node did not match.{Environment.NewLine}Expected: {Formatter.Format(typeof(TSource))},{Environment.NewLine} Found: {Formatter.Format(value.GetType())}") + .LogTrace(); } /// diff --git a/Source/aweXpect.Core/Core/Nodes/MappingNode.cs b/Source/aweXpect.Core/Core/Nodes/MappingNode.cs index 6f116b08d..9f0a5a578 100644 --- a/Source/aweXpect.Core/Core/Nodes/MappingNode.cs +++ b/Source/aweXpect.Core/Core/Nodes/MappingNode.cs @@ -43,16 +43,16 @@ public override async Task IsMetBy( return result.Fail("it was ", value); } - if (value is not TSource typedValue) + if (value is TSource typedValue) { - throw new InvalidOperationException( - $"The member type for the actual value in the which node did not match.{Environment.NewLine}Expected: {Formatter.Format(typeof(TSource))},{Environment.NewLine} Found: {Formatter.Format(value.GetType())}") - .LogTrace(); + TTarget matchingValue = _memberAccessor.AccessMember(typedValue); + ConstraintResult memberResult = await base.IsMetBy(matchingValue, context, cancellationToken); + return memberResult.UseValue(value); } - TTarget matchingValue = _memberAccessor.AccessMember(typedValue); - ConstraintResult memberResult = await base.IsMetBy(matchingValue, context, cancellationToken); - return memberResult.UseValue(value); + throw new InvalidOperationException( + $"The member type for the actual value in the which node did not match.{Environment.NewLine}Expected: {Formatter.Format(typeof(TSource))},{Environment.NewLine} Found: {Formatter.Format(value.GetType())}") + .LogTrace(); } /// diff --git a/Source/aweXpect.Core/Core/Nodes/WhichNode.cs b/Source/aweXpect.Core/Core/Nodes/WhichNode.cs index 26fb345a9..5d14cac52 100644 --- a/Source/aweXpect.Core/Core/Nodes/WhichNode.cs +++ b/Source/aweXpect.Core/Core/Nodes/WhichNode.cs @@ -90,26 +90,26 @@ public override async Task IsMetBy( FurtherProcessingStrategy.IgnoreResult, default); } - if (value is not TSource typedValue) + if (value is TSource typedValue) { - throw new InvalidOperationException( - $"The member type for the actual value in the which node did not match.{Environment.NewLine} Found: {Formatter.Format(value.GetType())}{Environment.NewLine} Expected: {Formatter.Format(typeof(TSource))}") - .LogTrace(); - } + TMember? matchingValue; + if (_memberAccessor != null) + { + matchingValue = _memberAccessor(typedValue); + } + else + { + matchingValue = await _asyncMemberAccessor!.Invoke(typedValue); + } - TMember? matchingValue; - if (_memberAccessor != null) - { - matchingValue = _memberAccessor(typedValue); - } - else - { - matchingValue = await _asyncMemberAccessor!.Invoke(typedValue); + ConstraintResult result = await _inner.IsMetBy(matchingValue, context, cancellationToken); + return CombineResults(parentResult, result, _separator ?? "", FurtherProcessingStrategy.IgnoreResult, + matchingValue); } - ConstraintResult result = await _inner.IsMetBy(matchingValue, context, cancellationToken); - return CombineResults(parentResult, result, _separator ?? "", FurtherProcessingStrategy.IgnoreResult, - matchingValue); + throw new InvalidOperationException( + $"The member type for the actual value in the which node did not match.{Environment.NewLine} Found: {Formatter.Format(value.GetType())}{Environment.NewLine} Expected: {Formatter.Format(typeof(TSource))}") + .LogTrace(); } ///