Skip to content

Commit 299284b

Browse files
committed
Ported Controllers.Views.ActionResults.Test package (#326)
1 parent 7159079 commit 299284b

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

test/MyTested.AspNetCore.Mvc.Controllers.Views.ActionResults.Test/BuildersTests/ActionResultsTests/JsonTests/JsonTestBuilderTests.cs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,14 @@ public void WithDefaultJsonSettingsShouldNotThrowExceptionAndPassAssertions()
3636
}
3737

3838
[Fact]
39-
public void WithDefaultJsonSettingsShouldThrowExceptionWithNull()
39+
public void WithDefaultJsonSettingsShouldWorkCorrectlyWithNull()
4040
{
41-
Assert.Throws<InvocationAssertionException>(() =>
42-
{
43-
MyController<MvcController>
44-
.Instance()
45-
.Calling(c => c.JsonWithSpecificSettingsAction(null))
46-
.ShouldReturn()
47-
.Json(json => json
48-
.WithDefaultJsonSerializerSettings());
49-
});
41+
MyController<MvcController>
42+
.Instance()
43+
.Calling(c => c.JsonWithSpecificSettingsAction(null))
44+
.ShouldReturn()
45+
.Json(json => json
46+
.WithDefaultJsonSerializerSettings());
5047
}
5148

5249
[Fact]
@@ -151,11 +148,11 @@ public void WithJsonSerializerSettingsShouldThrowExceptionWithActionSettings()
151148
}
152149

153150
[Fact]
154-
public void WithJsonSerializerSettingsShouldThrowExceptionWithNull()
151+
public void WithJsonSerializerSettingsShouldThrowWithNull()
155152
{
156153
var jsonSettings = TestObjectFactory.GetJsonSerializerSettings();
157154

158-
Assert.Throws<InvocationAssertionException>(() =>
155+
Assert.Throws<JsonResultAssertionException>(() =>
159156
{
160157
MyController<MvcController>
161158
.Instance()

test/MyTested.AspNetCore.Mvc.Controllers.Views.ActionResults.Test/MyTested.AspNetCore.Mvc.Controllers.Views.ActionResults.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp2.2;net461</TargetFrameworks>
4+
<TargetFramework>netcoreapp3.0</TargetFramework>
55
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
66
<AssemblyName>MyTested.AspNetCore.Mvc.Test</AssemblyName>
77
<AssemblyOriginatorKeyFile>../../tools/Key.snk</AssemblyOriginatorKeyFile>

test/MyTested.AspNetCore.Mvc.Controllers.Views.ActionResults.Test/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
using System.Reflection;
22
using System.Runtime.InteropServices;
3+
using Microsoft.AspNetCore.Mvc.ApplicationParts;
34
using Xunit;
45

6+
[assembly: ApplicationPart("MyTested.AspNetCore.Mvc.Test.Setups")]
7+
58
[assembly: AssemblyProduct("MyTested.AspNetCore.Mvc.Controllers.Views.ActionResults.Test")]
69
[assembly: ComVisible(false)]
710

test/MyTested.AspNetCore.Mvc.Controllers.Views.Test/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
using System.Reflection;
22
using System.Runtime.InteropServices;
3+
using Microsoft.AspNetCore.Mvc.ApplicationParts;
34
using Xunit;
45

6+
[assembly: ApplicationPart("MyTested.AspNetCore.Mvc.Test.Setups")]
7+
58
[assembly: AssemblyProduct("MyTested.AspNetCore.Mvc.ViewActionResults.Test")]
69
[assembly: ComVisible(false)]
710

0 commit comments

Comments
 (0)