Skip to content

Commit 397c3bf

Browse files
committed
Fixing some tests.
1 parent 5f4f1df commit 397c3bf

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Griesoft.AspNetCore.ReCaptcha.Extensions
6+
{
7+
internal static class LoggerExtensions
8+
{
9+
10+
}
11+
}

tests/ReCaptcha.Tests/TagHelpers/RecaptchaInvisibleTagHelperTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public void Process_ShouldThrow_ArgumentNullException_WhenOutputNull()
170170
}
171171

172172
[Test]
173-
public void Process_ShouldThrow_NullReferenceException_WhenCallbackAndFormIdNullOrEmpty()
173+
public void Process_ShouldThrow_InvalidOperationException_WhenCallbackAndFormIdNullOrEmpty()
174174
{
175175
// Arrange
176176
var nullCallbackTagHelper = new RecaptchaInvisibleTagHelper(_settingsMock.Object, _optionsMock.Object, _tagHelperComponentManagerMock.Object)
@@ -188,8 +188,8 @@ public void Process_ShouldThrow_NullReferenceException_WhenCallbackAndFormIdNull
188188

189189

190190
// Assert
191-
Assert.Throws<NullReferenceException>(() => nullCallbackTagHelper.Process(_contextStub, _tagHelperOutputStub));
192-
Assert.Throws<NullReferenceException>(() => emptyCallbackTagHelper.Process(_contextStub, _tagHelperOutputStub));
191+
Assert.Throws<InvalidOperationException>(() => nullCallbackTagHelper.Process(_contextStub, _tagHelperOutputStub));
192+
Assert.Throws<InvalidOperationException>(() => emptyCallbackTagHelper.Process(_contextStub, _tagHelperOutputStub));
193193
}
194194

195195
[Test]

tests/ReCaptcha.Tests/TagHelpers/RecaptchaV3TagHelperTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public void Process_ShouldThrow_ArgumentNullException()
110110
}
111111

112112
[Test]
113-
public void Process_ShouldThrow_NullReferenceException_WhenCallbackAndFormIdNullOrEmpty()
113+
public void Process_ShouldThrow_InvalidOperationException_WhenCallbackAndFormIdNullOrEmpty()
114114
{
115115
// Arrange
116116
var nullCallbackTagHelper = new RecaptchaV3TagHelper(_settingsMock.Object, _tagHelperComponentManagerMock.Object)
@@ -128,12 +128,12 @@ public void Process_ShouldThrow_NullReferenceException_WhenCallbackAndFormIdNull
128128

129129

130130
// Assert
131-
Assert.Throws<NullReferenceException>(() => nullCallbackTagHelper.Process(_contextStub, _tagHelperOutputStub));
132-
Assert.Throws<NullReferenceException>(() => emptyCallbackTagHelper.Process(_contextStub, _tagHelperOutputStub));
131+
Assert.Throws<InvalidOperationException>(() => nullCallbackTagHelper.Process(_contextStub, _tagHelperOutputStub));
132+
Assert.Throws<InvalidOperationException>(() => emptyCallbackTagHelper.Process(_contextStub, _tagHelperOutputStub));
133133
}
134134

135135
[Test]
136-
public void Process_ShouldThrow_NullReferenceException_WhenActionIsNullOrEmpty()
136+
public void Process_ShouldThrow_InvalidOperationException_WhenActionIsNullOrEmpty()
137137
{
138138
// Arrange
139139
var nullCallbackTagHelper = new RecaptchaV3TagHelper(_settingsMock.Object, _tagHelperComponentManagerMock.Object)
@@ -151,8 +151,8 @@ public void Process_ShouldThrow_NullReferenceException_WhenActionIsNullOrEmpty()
151151

152152

153153
// Assert
154-
Assert.Throws<NullReferenceException>(() => nullCallbackTagHelper.Process(_contextStub, _tagHelperOutputStub));
155-
Assert.Throws<NullReferenceException>(() => emptyCallbackTagHelper.Process(_contextStub, _tagHelperOutputStub));
154+
Assert.Throws<InvalidOperationException>(() => nullCallbackTagHelper.Process(_contextStub, _tagHelperOutputStub));
155+
Assert.Throws<InvalidOperationException>(() => emptyCallbackTagHelper.Process(_contextStub, _tagHelperOutputStub));
156156
}
157157

158158
[Test]

0 commit comments

Comments
 (0)