Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Pipeline/Build.MutationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ private void ExecuteMutationTest(Project project, Project[] testProjects)

DotNetToolInstall(_ => _
.SetPackageName("dotnet-stryker")
.SetVersion("4.7.0")
.SetToolInstallationPath(toolPath));

string branchName = BranchName;
Expand Down
14 changes: 7 additions & 7 deletions Source/aweXpect.Core/Core/Nodes/AsyncMappingNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ public override async Task<ConstraintResult> IsMetBy<TValue>(
return result.Fail("it was <null>", 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();
}

/// <inheritdoc cref="object.Equals(object?)" />
Expand Down
14 changes: 7 additions & 7 deletions Source/aweXpect.Core/Core/Nodes/MappingNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ public override async Task<ConstraintResult> IsMetBy<TValue>(
return result.Fail("it was <null>", 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();
}

/// <inheritdoc cref="object.Equals(object?)" />
Expand Down
32 changes: 16 additions & 16 deletions Source/aweXpect.Core/Core/Nodes/WhichNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,26 +90,26 @@ public override async Task<ConstraintResult> IsMetBy<TValue>(
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();
}

/// <inheritdoc cref="object.Equals(object?)" />
Expand Down
Loading