From fd496c5dcc6ca496493737d27ac022e135a9ed02 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 6 Sep 2019 16:00:52 -0700 Subject: [PATCH] Fix bad find and replace in AssertionsUtilities --- .../FluentAssertions/AssertionsUtilities.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Analysis/Ast/Test/FluentAssertions/AssertionsUtilities.cs b/src/Analysis/Ast/Test/FluentAssertions/AssertionsUtilities.cs index 83ff1b3a1..7318a7c11 100644 --- a/src/Analysis/Ast/Test/FluentAssertions/AssertionsUtilities.cs +++ b/src/Analysis/Ast/Test/FluentAssertions/AssertionsUtilities.cs @@ -188,38 +188,38 @@ public static string DoubleEscape(string input) => input.Replace("\r", "\\\u200Br").Replace("\n", "\\\u200Bn").Replace("\t", @"\t"); [CustomAssertion] - public static Continuation AssertIsNotNull(this IAssertionScope IAssertionScope, T instance, string subjectName, string itemName, string accessorName) + public static Continuation AssertIsNotNull(this IAssertionScope assertionScope, T instance, string subjectName, string itemName, string accessorName) where T : class - => IAssertionScope.ForCondition(!(instance is null)) + => assertionScope.ForCondition(!(instance is null)) .FailWith($"Expected {subjectName} to have {itemName}{{reason}}, but {accessorName} is null."); [CustomAssertion] - public static Continuation AssertAtIndex(this IAssertionScope IAssertionScope, IReadOnlyList collection, int index, string subjectName, string itemName) - where T : class => IAssertionScope.ForCondition(collection.Count > index) + public static Continuation AssertAtIndex(this IAssertionScope assertionScope, IReadOnlyList collection, int index, string subjectName, string itemName) + where T : class => assertionScope.ForCondition(collection.Count > index) .FailWith($"Expected {subjectName} to have {itemName} of type {typeof(T).Name} at index {index}{{reason}}, but collection has only {collection.Count} items.", subjectName, itemName) .Then .ForCondition(collection[index] is TItem) .FailWith($"Expected {subjectName} to have {itemName} of type `{typeof(T).Name}` at index {index}{{reason}}, but its type is `{collection[index].GetType().Name}`."); [CustomAssertion] - public static Continuation AssertHasMember(this IAssertionScope IAssertionScope, IMember m, string memberName, string analysisValueName, string memberPrintName, out IMember member) { + public static Continuation AssertHasMember(this IAssertionScope assertionScope, IMember m, string memberName, string analysisValueName, string memberPrintName, out IMember member) { var t = m.GetPythonType(); t.Should().BeAssignableTo(); try { member = ((IMemberContainer)m).GetMember(memberName); } catch (Exception e) { member = null; - return IAssertionScope.FailWith($"Expected {analysisValueName} to have a {memberPrintName}{{reason}}, but {nameof(t.GetMember)} has failed with exception: {e}."); + return assertionScope.FailWith($"Expected {analysisValueName} to have a {memberPrintName}{{reason}}, but {nameof(t.GetMember)} has failed with exception: {e}."); } - return IAssertionScope.ForCondition(!(member is null)) + return assertionScope.ForCondition(!(member is null)) .FailWith($"Expected {analysisValueName} to have a {memberPrintName}{{reason}}."); } [CustomAssertion] - public static Continuation AssertHasMemberOfType(this IAssertionScope IAssertionScope, IPythonType type, string memberName, string analysisValueName, string memberPrintName, out TMember typedMember) + public static Continuation AssertHasMemberOfType(this IAssertionScope assertionScope, IPythonType type, string memberName, string analysisValueName, string memberPrintName, out TMember typedMember) where TMember : class, IPythonType { - var continuation = IAssertionScope.AssertHasMember(type, memberName, analysisValueName, memberPrintName, out var member) + var continuation = assertionScope.AssertHasMember(type, memberName, analysisValueName, memberPrintName, out var member) .Then .ForCondition(member is TMember) .FailWith($"Expected {analysisValueName} to have a {memberPrintName} of type {typeof(TMember)}{{reason}}, but its type is {member.GetType()}.");