Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit d74dc84

Browse files
authored
Fix bad find and replace in AssertionsUtilities (microsoft#1527)
1 parent eb5c56d commit d74dc84

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/Analysis/Ast/Test/FluentAssertions/AssertionsUtilities.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,38 +188,38 @@ public static string DoubleEscape(string input)
188188
=> input.Replace("\r", "\\\u200Br").Replace("\n", "\\\u200Bn").Replace("\t", @"\t");
189189

190190
[CustomAssertion]
191-
public static Continuation AssertIsNotNull<T>(this IAssertionScope IAssertionScope, T instance, string subjectName, string itemName, string accessorName)
191+
public static Continuation AssertIsNotNull<T>(this IAssertionScope assertionScope, T instance, string subjectName, string itemName, string accessorName)
192192
where T : class
193-
=> IAssertionScope.ForCondition(!(instance is null))
193+
=> assertionScope.ForCondition(!(instance is null))
194194
.FailWith($"Expected {subjectName} to have {itemName}{{reason}}, but {accessorName} is null.");
195195

196196
[CustomAssertion]
197-
public static Continuation AssertAtIndex<T, TItem>(this IAssertionScope IAssertionScope, IReadOnlyList<T> collection, int index, string subjectName, string itemName)
198-
where T : class => IAssertionScope.ForCondition(collection.Count > index)
197+
public static Continuation AssertAtIndex<T, TItem>(this IAssertionScope assertionScope, IReadOnlyList<T> collection, int index, string subjectName, string itemName)
198+
where T : class => assertionScope.ForCondition(collection.Count > index)
199199
.FailWith($"Expected {subjectName} to have {itemName} of type {typeof(T).Name} at index {index}{{reason}}, but collection has only {collection.Count} items.", subjectName, itemName)
200200
.Then
201201
.ForCondition(collection[index] is TItem)
202202
.FailWith($"Expected {subjectName} to have {itemName} of type `{typeof(T).Name}` at index {index}{{reason}}, but its type is `{collection[index].GetType().Name}`.");
203203

204204
[CustomAssertion]
205-
public static Continuation AssertHasMember(this IAssertionScope IAssertionScope, IMember m, string memberName, string analysisValueName, string memberPrintName, out IMember member) {
205+
public static Continuation AssertHasMember(this IAssertionScope assertionScope, IMember m, string memberName, string analysisValueName, string memberPrintName, out IMember member) {
206206
var t = m.GetPythonType();
207207
t.Should().BeAssignableTo<IMemberContainer>();
208208
try {
209209
member = ((IMemberContainer)m).GetMember(memberName);
210210
} catch (Exception e) {
211211
member = null;
212-
return IAssertionScope.FailWith($"Expected {analysisValueName} to have a {memberPrintName}{{reason}}, but {nameof(t.GetMember)} has failed with exception: {e}.");
212+
return assertionScope.FailWith($"Expected {analysisValueName} to have a {memberPrintName}{{reason}}, but {nameof(t.GetMember)} has failed with exception: {e}.");
213213
}
214214

215-
return IAssertionScope.ForCondition(!(member is null))
215+
return assertionScope.ForCondition(!(member is null))
216216
.FailWith($"Expected {analysisValueName} to have a {memberPrintName}{{reason}}.");
217217
}
218218

219219
[CustomAssertion]
220-
public static Continuation AssertHasMemberOfType<TMember>(this IAssertionScope IAssertionScope, IPythonType type, string memberName, string analysisValueName, string memberPrintName, out TMember typedMember)
220+
public static Continuation AssertHasMemberOfType<TMember>(this IAssertionScope assertionScope, IPythonType type, string memberName, string analysisValueName, string memberPrintName, out TMember typedMember)
221221
where TMember : class, IPythonType {
222-
var continuation = IAssertionScope.AssertHasMember(type, memberName, analysisValueName, memberPrintName, out var member)
222+
var continuation = assertionScope.AssertHasMember(type, memberName, analysisValueName, memberPrintName, out var member)
223223
.Then
224224
.ForCondition(member is TMember)
225225
.FailWith($"Expected {analysisValueName} to have a {memberPrintName} of type {typeof(TMember)}{{reason}}, but its type is {member.GetType()}.");

0 commit comments

Comments
 (0)