Skip to content

Commit 2d4a48a

Browse files
committed
Fix conflicts with new assertion overloads
1 parent 9780565 commit 2d4a48a

47 files changed

Lines changed: 74 additions & 14 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Lucene.Net.TestFramework/Support/TestFramework/Assert.cs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -910,16 +910,18 @@ public static void DoesNotThrow(Action action)
910910

911911
[DebuggerStepThrough]
912912
[MethodImpl(MethodImplOptions.AggressiveInlining)]
913-
public static Exception Throws<TException>(Action action, string message, params object[] args)
913+
public static TException Throws<TException>(Action action, string message, params object[] args)
914+
where TException : Exception
914915
{
915-
return Throws(typeof(TException), action, message, args);
916+
return NUnit.Framework.Assert.Throws<TException>(action, message, args)!;
916917
}
917918

918919
[DebuggerStepThrough]
919920
[MethodImpl(MethodImplOptions.AggressiveInlining)]
920-
public static Exception Throws<TException>(Action action)
921+
public static TException Throws<TException>(Action action)
922+
where TException : Exception
921923
{
922-
return Throws(typeof(TException), action);
924+
return NUnit.Framework.Assert.Throws<TException>(action)!;
923925
}
924926

925927
[DebuggerStepThrough]
@@ -953,6 +955,20 @@ public static T Throws<T>(string expectedParamName, Action action)
953955
return exception;
954956
}
955957

958+
[DebuggerStepThrough]
959+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
960+
public static Exception Catch(Action action)
961+
{
962+
return NUnit.Framework.Assert.Catch(action);
963+
}
964+
965+
[DebuggerStepThrough]
966+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
967+
public static Exception Catch(Action action, string message, params object[] args)
968+
{
969+
return NUnit.Framework.Assert.Catch(action, message, args);
970+
}
971+
956972
[DebuggerStepThrough]
957973
public static Exception ThrowsFileAlreadyExistsException(string filePath, Action action)
958974
{

src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestCapitalizationFilter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Globalization;
88
using System.IO;
99
using JCG = J2N.Collections.Generic;
10+
using Assert = Lucene.Net.TestFramework.Assert;
1011

1112
namespace Lucene.Net.Analysis.Miscellaneous
1213
{

src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestCodepointCountFilter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using NUnit.Framework;
66
using System;
77
using System.IO;
8+
using Assert = Lucene.Net.TestFramework.Assert;
89

910
namespace Lucene.Net.Analysis.Miscellaneous
1011
{

src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLengthFilter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using NUnit.Framework;
55
using System;
66
using System.IO;
7+
using Assert = Lucene.Net.TestFramework.Assert;
78

89
namespace Lucene.Net.Analysis.Miscellaneous
910
{

src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenCountFilter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using NUnit.Framework;
33
using System;
44
using System.IO;
5+
using Assert = Lucene.Net.TestFramework.Assert;
56

67
namespace Lucene.Net.Analysis.Miscellaneous
78
{

src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenPositionFilter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using NUnit.Framework;
55
using System;
66
using System.IO;
7+
using Assert = Lucene.Net.TestFramework.Assert;
78

89
namespace Lucene.Net.Analysis.Miscellaneous
910
{

src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestPerFieldAnalyzerWrapper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using NUnit.Framework;
99
using System.Collections.Generic;
1010
using JCG = J2N.Collections.Generic;
11+
using Assert = Lucene.Net.TestFramework.Assert;
1112

1213
namespace Lucene.Net.Analysis.Miscellaneous
1314
{

src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTruncateTokenFilter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using NUnit.Framework;
33
using System;
44
using System.IO;
5+
using Assert = Lucene.Net.TestFramework.Assert;
56

67
namespace Lucene.Net.Analysis.Miscellaneous
78
{

src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TokenRangeSinkTokenizerTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using NUnit.Framework;
33
using System;
44
using System.IO;
5+
using Assert = Lucene.Net.TestFramework.Assert;
56

67
namespace Lucene.Net.Analysis.Sinks
78
{

src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArrayMap.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using System.Linq;
1313
using System.Text;
1414
using JCG = J2N.Collections.Generic;
15+
using Assert = Lucene.Net.TestFramework.Assert;
1516

1617
namespace Lucene.Net.Analysis.Util
1718
{

0 commit comments

Comments
 (0)