@@ -37,6 +37,83 @@ protected override CreateChangedDocument TryComputeFixCore(IInvocationOperation
37
37
38
38
private CreateChangedDocument TryComputeFixForNunitClassicAssert ( IInvocationOperation invocation , CodeFixContext context , NunitCodeFixContext t )
39
39
{
40
+ /*
41
+ public static void Greater(IComparable arg1, IComparable arg2, string message, params object[] args)
42
+ public static void Greater(IComparable arg1, IComparable arg2)
43
+ public static void Less(IComparable arg1, IComparable arg2, string message, params object[] args)
44
+ public static void Less(IComparable arg1, IComparable arg2)
45
+ public static void GreaterOrEqual(IComparable arg1, IComparable arg2, string message, params object[] args)
46
+ public static void GreaterOrEqual(IComparable arg1, IComparable arg2)
47
+ public static void LessOrEqual(IComparable arg1, IComparable arg2, string message, params object[] args)
48
+ public static void LessOrEqual(IComparable arg1, IComparable arg2)
49
+ public static void IsNaN(double aDouble, string? message, params object?[]? args)
50
+ public static void IsNaN(double aDouble)
51
+ public static void IsNaN(double? aDouble, string? message, params object?[]? args)
52
+ public static void IsNaN(double? aDouble)
53
+ public static void IsEmpty(IEnumerable collection, string? message, params object?[]? args)
54
+ public static void IsEmpty(IEnumerable collection)
55
+ public static void IsNotEmpty(IEnumerable collection, string? message, params object?[]? args)
56
+ public static void IsNotEmpty(IEnumerable collection)
57
+ public static void Pass(string? message, params object?[]? args)
58
+ public static void Pass(string? message)
59
+ public static void Pass()
60
+ public static void Fail(string? message, params object?[]? args)
61
+ public static void Fail(string? message)
62
+ public static void Fail()
63
+ public static void Warn(string? message, params object?[]? args)
64
+ public static void Warn(string? message)
65
+ public static void Ignore(string? message, params object?[]? args)
66
+ public static void Ignore(string? message)
67
+ public static void Ignore()
68
+ public static void Inconclusive(string? message, params object?[]? args)
69
+ public static void Inconclusive(string? message)
70
+ public static void Inconclusive()
71
+ public static void Multiple(TestDelegate testDelegate)
72
+ public static void Multiple(AsyncTestDelegate testDelegate)
73
+ public static Exception? ThrowsAsync(IResolveConstraint expression, AsyncTestDelegate code, string? message, params object?[]? args)
74
+ public static Exception? ThrowsAsync(IResolveConstraint expression, AsyncTestDelegate code)
75
+ public static Exception? ThrowsAsync(Type expectedExceptionType, AsyncTestDelegate code, string? message, params object?[]? args)
76
+ public static Exception? ThrowsAsync(Type expectedExceptionType, AsyncTestDelegate code)
77
+ public static TActual? ThrowsAsync<TActual>(AsyncTestDelegate code, string? message, params object?[]? args) where TActual : Exception
78
+ public static TActual? ThrowsAsync<TActual>(AsyncTestDelegate code) where TActual : Exception
79
+ public static Exception? CatchAsync(AsyncTestDelegate code, string? message, params object?[]? args)
80
+ public static Exception? CatchAsync(AsyncTestDelegate code)
81
+ public static Exception? CatchAsync(Type expectedExceptionType, AsyncTestDelegate code, string? message, params object?[]? args)
82
+ public static Exception? CatchAsync(Type expectedExceptionType, AsyncTestDelegate code)
83
+ public static TActual? CatchAsync<TActual>(AsyncTestDelegate code, string? message, params object?[]? args) where TActual : Exception
84
+ public static TActual? CatchAsync<TActual>(AsyncTestDelegate code) where TActual : Exception
85
+ public static void DoesNotThrowAsync(AsyncTestDelegate code, string? message, params object?[]? args)
86
+ public static void DoesNotThrowAsync(AsyncTestDelegate code)
87
+ public static Exception? Throws(IResolveConstraint expression, TestDelegate code, string? message, params object?[]? args)
88
+ public static Exception? Throws(IResolveConstraint expression, TestDelegate code)
89
+ public static Exception? Throws(Type expectedExceptionType, TestDelegate code, string? message, params object?[]? args)
90
+ public static Exception? Throws(Type expectedExceptionType, TestDelegate code)
91
+ public static TActual? Throws<TActual>(TestDelegate code, string? message, params object?[]? args) where TActual : Exception
92
+ public static TActual? Throws<TActual>(TestDelegate code) where TActual : Exception
93
+ public static Exception? Catch(TestDelegate code, string? message, params object?[]? args)
94
+ public static Exception? Catch(TestDelegate code)
95
+ public static Exception? Catch(Type expectedExceptionType, TestDelegate code, string? message, params object?[]? args)
96
+ public static Exception? Catch(Type expectedExceptionType, TestDelegate code)
97
+ public static TActual? Catch<TActual>(TestDelegate code, string? message, params object?[]? args) where TActual : Exception
98
+ public static TActual? Catch<TActual>(TestDelegate code) where TActual : Exception
99
+ public static void DoesNotThrow(TestDelegate code, string? message, params object?[]? args)
100
+ public static void DoesNotThrow(TestDelegate code)
101
+ public static void That(Func<bool> condition, string? message, params object?[]? args)
102
+ public static void That(Func<bool> condition)
103
+ public static void That(Func<bool> condition, Func<string?> getExceptionMessage)
104
+ public static void That<TActual>(ActualValueDelegate<TActual> del, IResolveConstraint expr)
105
+ public static void That<TActual>(ActualValueDelegate<TActual> del, IResolveConstraint expr, string? message, params object?[]? args)
106
+ public static void That<TActual>(ActualValueDelegate<TActual> del, IResolveConstraint expr, Func<string?> getExceptionMessage)
107
+ public static void That(TestDelegate code, IResolveConstraint constraint)
108
+ public static void That(TestDelegate code, IResolveConstraint constraint, string? message, params object?[]? args)
109
+ public static void That(TestDelegate code, IResolveConstraint constraint, Func<string?> getExceptionMessage)
110
+ public static void That<TActual>(TActual actual, IResolveConstraint expression)
111
+ public static void That<TActual>(TActual actual, IResolveConstraint expression, string? message, params object?[]? args)
112
+ public static void That<TActual>(TActual actual, IResolveConstraint expression, Func<string?> getExceptionMessage)
113
+ public static void ByVal(object? actual, IResolveConstraint expression)
114
+ public static void ByVal(object? actual, IResolveConstraint expression, string? message, params object?[]? args)
115
+ */
116
+
40
117
switch ( invocation . TargetMethod . Name )
41
118
{
42
119
case "True" : // Assert.True(bool condition)
@@ -273,6 +350,31 @@ public static void IsOrdered(IEnumerable collection, IComparer comparer)
273
350
return null ;
274
351
}
275
352
353
+ /* TODO:
354
+ StringAssert:
355
+
356
+ public static void Contains(string expected, string actual, string message, params object[] args)
357
+ public static void Contains(string expected, string actual)
358
+ public static void DoesNotContain(string expected, string actual, string message, params object[] args)
359
+ public static void DoesNotContain(string expected, string actual)
360
+ public static void StartsWith(string expected, string actual, string message, params object[] args)
361
+ public static void StartsWith(string expected, string actual)
362
+ public static void DoesNotStartWith(string expected, string actual, string message, params object[] args)
363
+ public static void DoesNotStartWith(string expected, string actual)
364
+ public static void EndsWith(string expected, string actual, string message, params object[] args)
365
+ public static void EndsWith(string expected, string actual)
366
+ public static void DoesNotEndWith(string expected, string actual, string message, params object[] args)
367
+ public static void DoesNotEndWith(string expected, string actual)
368
+ public static void AreEqualIgnoringCase(string expected, string actual, string message, params object[] args)
369
+ public static void AreEqualIgnoringCase(string expected, string actual)
370
+ public static void AreNotEqualIgnoringCase(string expected, string actual, string message, params object[] args)
371
+ public static void AreNotEqualIgnoringCase(string expected, string actual)
372
+ public static void IsMatch(string pattern, string actual, string message, params object[] args)
373
+ public static void IsMatch(string pattern, string actual)
374
+ public static void DoesNotMatch(string pattern, string actual, string message, params object[] args)
375
+ public static void DoesNotMatch(string pattern, string actual)
376
+ */
377
+
276
378
private CreateChangedDocument TryComputeFixForNunitThat ( IInvocationOperation invocation , CodeFixContext context , NunitCodeFixContext t )
277
379
{
278
380
// Assert.That(condition)
0 commit comments