Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ed98e0e

Browse files
committedSep 26, 2014
Merge pull request #38 from ByteBlast/master
Refactored ControllerResultTest class.
2 parents ae832b8 + fed01a3 commit ed98e0e

25 files changed

+1377
-1299
lines changed
 

‎.gitignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ _ReSharper*
1313
*/NUnit*/tools
1414
*/NhibernateProfiler*/tools
1515
packages
16-
*.DotSettings
1716
/TestStack.FluentMVCTesting.Example/App_Data

‎TestStack.FluentMVCTesting.Tests/ControllerResultTestTests.cs‎

Lines changed: 0 additions & 857 deletions
This file was deleted.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
using NUnit.Framework;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.IO;
5+
using System.Text;
6+
using System.Web.Mvc;
7+
using TestStack.FluentMVCTesting.Tests.TestControllers;
8+
9+
namespace TestStack.FluentMVCTesting.Tests
10+
{
11+
[TestFixture]
12+
partial class ControllerResultTestShould
13+
{
14+
private ControllerResultTestController _controller;
15+
16+
[SetUp]
17+
public void Setup()
18+
{
19+
_controller = new ControllerResultTestController();
20+
}
21+
22+
#region General Tests
23+
// Expected action return types for the different types of assertions
24+
private static readonly List<Tuple<string, TestAction>> ReturnTypes = new List<Tuple<string, TestAction>>
25+
{
26+
ReturnType<EmptyResult>(t => t.ShouldReturnEmptyResult()),
27+
ReturnType<RedirectResult>(t => t.ShouldRedirectTo("")),
28+
ReturnType<RedirectToRouteResult>(t => t.ShouldRedirectTo(c => c.EmptyResult)),
29+
ReturnType<RedirectToRouteResult>(t => t.ShouldRedirectTo<SomeOtherController>(c => c.SomeAction())),
30+
ReturnType<ViewResult>(t => t.ShouldRenderView("")),
31+
ReturnType<ViewResult>(t => t.ShouldRenderDefaultView()),
32+
ReturnType<PartialViewResult>(t => t.ShouldRenderPartialView("")),
33+
ReturnType<PartialViewResult>(t => t.ShouldRenderDefaultPartialView()),
34+
ReturnType<FileContentResult>(t => t.ShouldRenderFileContents()),
35+
ReturnType<FileContentResult>(t => t.ShouldRenderFileContents(new byte[0])),
36+
ReturnType<FileContentResult>(t => t.ShouldRenderFileContents(new byte[0], "")),
37+
ReturnType<FileContentResult>(t => t.ShouldRenderFileContents("")),
38+
ReturnType<FileContentResult>(t => t.ShouldRenderFileContents("", "")),
39+
ReturnType<FileContentResult>(t => t.ShouldRenderFileContents("", "", Encoding.UTF8)),
40+
ReturnType<FilePathResult>(t => t.ShouldRenderFilePath()),
41+
ReturnType<FilePathResult>(t => t.ShouldRenderFilePath("")),
42+
ReturnType<FilePathResult>(t => t.ShouldRenderFilePath("", "")),
43+
ReturnType<FileStreamResult>(t => t.ShouldRenderFileStream()),
44+
ReturnType<FileStreamResult>(t => t.ShouldRenderFileStream(new MemoryStream())),
45+
ReturnType<FileStreamResult>(t => t.ShouldRenderFileStream(contentType: "")),
46+
ReturnType<FileStreamResult>(t => t.ShouldRenderFileStream(new MemoryStream(), "")),
47+
ReturnType<FileStreamResult>(t => t.ShouldRenderFileStream(new byte[0])),
48+
ReturnType<FileStreamResult>(t => t.ShouldRenderFileStream(new byte[0], "")),
49+
ReturnType<FileStreamResult>(t => t.ShouldRenderFileStream("")),
50+
ReturnType<FileStreamResult>(t => t.ShouldRenderFileStream("", "")),
51+
ReturnType<FileStreamResult>(t => t.ShouldRenderFileStream("", "", Encoding.UTF8)),
52+
ReturnType<FileResult>(t => t.ShouldRenderAnyFile()),
53+
ReturnType<HttpStatusCodeResult>(t => t.ShouldGiveHttpStatus()),
54+
ReturnType<JsonResult>(t => t.ShouldReturnJson()),
55+
ReturnType<ContentResult>(t => t.ShouldReturnContent()),
56+
ReturnType<ContentResult>(t => t.ShouldReturnContent("")),
57+
ReturnType<ContentResult>(t => t.ShouldReturnContent("", "")),
58+
ReturnType<ContentResult>(t => t.ShouldReturnContent("", "", Encoding.UTF8))
59+
};
60+
61+
[Test]
62+
[TestCaseSource("ReturnTypes")]
63+
public void Check_return_type(Tuple<string, TestAction> test)
64+
{
65+
var exception = Assert.Throws<ActionResultAssertionException>(() =>
66+
test.Item2(_controller.WithCallTo(c => c.RandomResult()))
67+
);
68+
Assert.That(exception.Message, Is.EqualTo(string.Format("Expected action result to be a {0}, but instead received a RandomResult.", test.Item1)));
69+
}
70+
71+
[Test]
72+
[TestCaseSource("ReturnTypes")]
73+
public void Check_null_return(Tuple<string, TestAction> test)
74+
{
75+
var exception = Assert.Throws<ActionResultAssertionException>(() =>
76+
test.Item2(_controller.WithCallTo(c => c.Null()))
77+
);
78+
Assert.That(exception.Message, Is.EqualTo(string.Format("Received null action result when expecting {0}.", test.Item1)));
79+
}
80+
#endregion
81+
}
82+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System.Net;
2+
using NUnit.Framework;
3+
using TestStack.FluentMVCTesting.Tests.TestControllers;
4+
5+
namespace TestStack.FluentMVCTesting.Tests
6+
{
7+
partial class ControllerResultTestShould
8+
{
9+
[Test]
10+
public void Check_for_http_not_found()
11+
{
12+
_controller.WithCallTo(c => c.NotFound()).ShouldGiveHttpStatus(HttpStatusCode.NotFound);
13+
}
14+
15+
[Test]
16+
public void Check_for_http_status()
17+
{
18+
_controller.WithCallTo(c => c.StatusCode()).ShouldGiveHttpStatus(ControllerResultTestController.Code);
19+
}
20+
21+
[Test]
22+
public void Check_for_invalid_http_status()
23+
{
24+
var exception = Assert.Throws<ActionResultAssertionException>(() =>
25+
_controller.WithCallTo(c => c.StatusCode()).ShouldGiveHttpStatus(ControllerResultTestController.Code + 1)
26+
);
27+
Assert.That(exception.Message, Is.EqualTo(string.Format("Expected HTTP status code to be '{0}', but instead received a '{1}'.", ControllerResultTestController.Code + 1, ControllerResultTestController.Code)));
28+
}
29+
}
30+
}
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq.Expressions;
4+
using System.Web.Mvc;
5+
using NUnit.Framework;
6+
using TestStack.FluentMVCTesting.Tests.TestControllers;
7+
8+
namespace TestStack.FluentMVCTesting.Tests
9+
{
10+
partial class ControllerResultTestShould
11+
{
12+
// Different ways that action redirects can be asserted along with the expected method name and the correct controller action call for that assertion
13+
private static readonly List<RedirectToActionTestMetadata> ActionRedirects = new List<RedirectToActionTestMetadata>
14+
{
15+
ActionRedirect("ActionWithNoParameters",
16+
t => t.ShouldRedirectTo(c => c.ActionWithNoParameters),
17+
c => c.RedirectToActionWithNoParameters()
18+
),
19+
ActionRedirect("ActionWithOneParameter",
20+
t => t.ShouldRedirectTo(c => c.ActionWithOneParameter),
21+
c => c.RedirectToActionWithOneParameter()
22+
),
23+
ActionRedirect("ActionWithOneParameter",
24+
t => t.ShouldRedirectTo<int>(c => c.ActionWithOneParameter),
25+
c => c.RedirectToActionWithOneParameter()
26+
),
27+
ActionRedirect("ActionWithTwoParameters",
28+
t => t.ShouldRedirectTo<int, int>(c => c.ActionWithTwoParameters),
29+
c => c.RedirectToActionWithTwoParameters()
30+
),
31+
ActionRedirect("ActionWithThreeParameters",
32+
t => t.ShouldRedirectTo<int, int, int>(c => c.ActionWithThreeParameters),
33+
c => c.RedirectToActionWithThreeParameters()
34+
),
35+
ActionRedirect("ActionWithNoParameters",
36+
t => t.ShouldRedirectTo(c => c.ActionWithNoParameters()),
37+
c => c.RedirectToActionWithNoParameters()
38+
),
39+
ActionRedirect("ActionWithOneParameter",
40+
t => t.ShouldRedirectTo(c => c.ActionWithOneParameter(0)),
41+
c => c.RedirectToActionWithOneParameter()
42+
),
43+
ActionRedirect("ActionWithTwoParameters",
44+
t => t.ShouldRedirectTo(c => c.ActionWithTwoParameters(0, 0)),
45+
c => c.RedirectToActionWithTwoParameters()
46+
),
47+
ActionRedirect("ActionWithThreeParameters",
48+
t => t.ShouldRedirectTo(c => c.ActionWithThreeParameters(0, 0, 0)),
49+
c => c.RedirectToActionWithThreeParameters()
50+
),
51+
ActionRedirect("ActionWithMoreThanThreeParameters",
52+
t => t.ShouldRedirectTo(c => c.ActionWithMoreThanThreeParameters(0, 0, 0, 0)),
53+
c => c.RedirectToActionWithMoreThanThreeParameters()
54+
),
55+
ActionRedirect("ActionWithMoreThanThreeParameters",
56+
t => t.ShouldRedirectTo(typeof(ControllerResultTestController).GetMethod("ActionWithMoreThanThreeParameters")),
57+
c => c.RedirectToActionWithMoreThanThreeParameters()
58+
),
59+
};
60+
61+
// Different ways that redirects to another controller can be asserted
62+
private static readonly List<TestAction> OtherControllerRedirects = new List<TestAction>
63+
{
64+
c => c.ShouldRedirectTo<SomeOtherController>(typeof(SomeOtherController).GetMethod("SomeAction")),
65+
c => c.ShouldRedirectTo<SomeOtherController>(c2 => c2.SomeAction()),
66+
};
67+
68+
public class RedirectToActionTestMetadata : Tuple<string, TestAction, Expression<Func<ControllerResultTestController, ActionResult>>>
69+
{
70+
public RedirectToActionTestMetadata(string expectedMethodName, TestAction testCall, Expression<Func<ControllerResultTestController, ActionResult>> validControllerActionCall)
71+
: base(expectedMethodName, testCall, validControllerActionCall) { }
72+
}
73+
74+
public delegate void TestAction(ControllerResultTest<ControllerResultTestController> testClass);
75+
76+
private static Tuple<string, TestAction> ReturnType<T>(TestAction a)
77+
{
78+
return new Tuple<string, TestAction>(typeof(T).Name, a);
79+
}
80+
81+
private static RedirectToActionTestMetadata ActionRedirect(string s, TestAction a, Expression<Func<ControllerResultTestController, ActionResult>> c)
82+
{
83+
return new RedirectToActionTestMetadata(s, a, c);
84+
}
85+
86+
[Test]
87+
public void Check_for_redirect_to_url()
88+
{
89+
_controller.WithCallTo(c => c.RedirectToUrl()).ShouldRedirectTo(ControllerResultTestController.RedirectUrl);
90+
}
91+
92+
[Test]
93+
public void Check_for_redirect_to_invalid_url()
94+
{
95+
const string url = "http://validurl/";
96+
var exception = Assert.Throws<ActionResultAssertionException>(() =>
97+
_controller.WithCallTo(c => c.RedirectToUrl()).ShouldRedirectTo(url)
98+
);
99+
Assert.That(exception.Message, Is.EqualTo(string.Format("Expected redirect to URL '{0}', but instead was given a redirect to URL '{1}'.", url, ControllerResultTestController.RedirectUrl)));
100+
}
101+
102+
[Test]
103+
public void Check_for_redirect_to_route_name()
104+
{
105+
_controller.WithCallTo(c => c.RedirectToRouteName()).ShouldRedirectToRoute(ControllerResultTestController.RouteName);
106+
}
107+
108+
[Test]
109+
public void Check_for_redirect_to_invalid_route_name()
110+
{
111+
const string routeName = "ValidRoute";
112+
var exception = Assert.Throws<ActionResultAssertionException>(() =>
113+
_controller.WithCallTo(c => c.RedirectToRouteName()).ShouldRedirectToRoute(routeName)
114+
);
115+
Assert.That(exception.Message, Is.EqualTo(string.Format("Expected redirect to route '{0}', but instead was given a redirect to route '{1}'.", routeName, ControllerResultTestController.RouteName)));
116+
}
117+
118+
[Test]
119+
[TestCaseSource("ActionRedirects")]
120+
public void Check_for_redirect_to_action(RedirectToActionTestMetadata test)
121+
{
122+
test.Item2(_controller.WithCallTo(test.Item3));
123+
}
124+
125+
[Test]
126+
[TestCaseSource("ActionRedirects")]
127+
public void Check_for_redirect_to_incorrect_controller(RedirectToActionTestMetadata test)
128+
{
129+
var exception = Assert.Throws<ActionResultAssertionException>(() =>
130+
test.Item2(_controller.WithCallTo(c => c.RedirectToAnotherController()))
131+
);
132+
Assert.That(exception.Message, Is.EqualTo("Expected redirect to controller 'ControllerResultTest', but instead was given a redirect to controller 'SomeOther'."));
133+
}
134+
135+
[Test]
136+
[TestCaseSource("ActionRedirects")]
137+
public void Check_for_redirect_to_incorrect_action(RedirectToActionTestMetadata test)
138+
{
139+
var exception = Assert.Throws<ActionResultAssertionException>(() =>
140+
test.Item2(_controller.WithCallTo(c => c.RedirectToRandomResult()))
141+
);
142+
Assert.That(exception.Message, Is.EqualTo(string.Format("Expected redirect to action '{0}', but instead was given a redirect to action 'RandomResult'.", test.Item1)));
143+
}
144+
145+
// todo: Test the route values expectations
146+
147+
[Test]
148+
[TestCaseSource("ActionRedirects")]
149+
public void Check_for_redirect_to_empty_action(RedirectToActionTestMetadata test)
150+
{
151+
var exception = Assert.Throws<ActionResultAssertionException>(() =>
152+
test.Item2(_controller.WithCallTo(c => c.RedirectToRouteName()))
153+
);
154+
Assert.That(exception.Message, Is.EqualTo(string.Format("Expected redirect to action '{0}', but instead was given a redirect without an action.", test.Item1)));
155+
}
156+
157+
[Test]
158+
[TestCaseSource("OtherControllerRedirects")]
159+
public void Check_for_redirect_to_another_controller(TestAction action)
160+
{
161+
action(_controller.WithCallTo(c => c.RedirectToAnotherController()));
162+
}
163+
164+
[Test]
165+
public void Check_for_redirect_to_incorrect_other_controller()
166+
{
167+
var exception = Assert.Throws<ActionResultAssertionException>(() =>
168+
_controller.WithCallTo(c => c.RedirectToAnotherController()).ShouldRedirectTo<YetAnotherController>(c => c.SomeAction())
169+
);
170+
Assert.That(exception.Message, Is.EqualTo("Expected redirect to controller 'YetAnother', but instead was given a redirect to controller 'SomeOther'."));
171+
}
172+
173+
[Test]
174+
public void Check_for_redirect_to_incorrect_action_in_another_controller()
175+
{
176+
var exception = Assert.Throws<ActionResultAssertionException>(() =>
177+
_controller.WithCallTo(c => c.RedirectToAnotherController()).ShouldRedirectTo<SomeOtherController>(c => c.SomeOtherAction())
178+
);
179+
Assert.That(exception.Message, Is.EqualTo("Expected redirect to action 'SomeOtherAction', but instead was given a redirect to action 'SomeAction'."));
180+
}
181+
182+
[Test]
183+
public void Check_for_redirect_to_action_with_non_specified_controller()
184+
{
185+
var exception = Assert.Throws<ActionResultAssertionException>(() =>
186+
_controller.WithCallTo(c => c.RedirectToAnotherActionNoController()).ShouldRedirectTo<SomeOtherController>(c => c.SomeOtherAction())
187+
);
188+
Assert.That(exception.Message, Is.EqualTo("Expected redirect to action 'SomeOtherAction' in 'SomeOther' controller, but instead was given redirect to action 'SomeAction' within the same controller."));
189+
}
190+
}
191+
}

‎TestStack.FluentMVCTesting.Tests/ControllerResultTestTests/ShouldRenderFileTests.cs‎

Lines changed: 425 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
using NUnit.Framework;
2+
using TestStack.FluentMVCTesting.Tests.TestControllers;
3+
4+
namespace TestStack.FluentMVCTesting.Tests
5+
{
6+
partial class ControllerResultTestShould
7+
{
8+
[Test]
9+
public void Check_for_default_view_or_partial()
10+
{
11+
_controller.WithCallTo(c => c.DefaultView()).ShouldRenderDefaultView();
12+
_controller.WithCallTo(c => c.DefaultView()).ShouldRenderView("DefaultView");
13+
_controller.WithCallTo(c => c.DefaultViewExplicit()).ShouldRenderDefaultView();
14+
_controller.WithCallTo(c => c.DefaultPartial()).ShouldRenderDefaultPartialView();
15+
_controller.WithCallTo(c => c.DefaultPartial()).ShouldRenderPartialView("DefaultPartial");
16+
_controller.WithCallTo(c => c.DefaultPartialExplicit()).ShouldRenderDefaultPartialView();
17+
}
18+
19+
[Test]
20+
public void Check_for_invalid_view_name_when_expecting_default_view()
21+
{
22+
var exception = Assert.Throws<ActionResultAssertionException>(() =>
23+
_controller.WithCallTo(c => c.RandomView()).ShouldRenderDefaultView()
24+
);
25+
Assert.That(exception.Message, Is.EqualTo(string.Format("Expected result view to be 'RandomView', but instead was given '{0}'.", ControllerResultTestController.RandomViewName)));
26+
}
27+
28+
[Test]
29+
public void Check_for_invalid_view_name_when_expecting_default_partial()
30+
{
31+
var exception = Assert.Throws<ActionResultAssertionException>(() =>
32+
_controller.WithCallTo(c => c.RandomPartial()).ShouldRenderDefaultPartialView()
33+
);
34+
Assert.That(exception.Message, Is.EqualTo(string.Format("Expected result view to be 'RandomPartial', but instead was given '{0}'.", ControllerResultTestController.RandomViewName)));
35+
}
36+
37+
[Test]
38+
public void Check_for_named_view_or_partial()
39+
{
40+
_controller.WithCallTo(c => c.NamedView()).ShouldRenderView(ControllerResultTestController.ViewName);
41+
_controller.WithCallTo(c => c.NamedPartial()).ShouldRenderPartialView(ControllerResultTestController.PartialName);
42+
}
43+
44+
[Test]
45+
public void Check_for_invalid_view_name()
46+
{
47+
var exception = Assert.Throws<ActionResultAssertionException>(() =>
48+
_controller.WithCallTo(c => c.RandomView()).ShouldRenderView(ControllerResultTestController.ViewName)
49+
);
50+
Assert.That(exception.Message, Is.EqualTo(string.Format("Expected result view to be '{0}', but instead was given '{1}'.", ControllerResultTestController.ViewName, ControllerResultTestController.RandomViewName)));
51+
}
52+
53+
[Test]
54+
public void Check_for_invalid_partial_name()
55+
{
56+
var exception = Assert.Throws<ActionResultAssertionException>(() =>
57+
_controller.WithCallTo(c => c.RandomPartial()).ShouldRenderPartialView(ControllerResultTestController.PartialName)
58+
);
59+
Assert.That(exception.Message, Is.EqualTo(string.Format("Expected result view to be '{0}', but instead was given '{1}'.", ControllerResultTestController.PartialName, ControllerResultTestController.RandomViewName)));
60+
}
61+
}
62+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
using NUnit.Framework;
2+
using System.Text;
3+
using TestStack.FluentMVCTesting.Tests.TestControllers;
4+
5+
namespace TestStack.FluentMVCTesting.Tests
6+
{
7+
partial class ControllerResultTestShould
8+
{
9+
[Test]
10+
public void Check_for_content_result()
11+
{
12+
_controller.WithCallTo(c => c.Content()).ShouldReturnContent();
13+
}
14+
15+
[Test]
16+
public void Check_for_content_result_and_check_content()
17+
{
18+
_controller.WithCallTo(c => c.Content()).ShouldReturnContent(ControllerResultTestController.TextualContent);
19+
}
20+
21+
[Test]
22+
public void Check_for_content_result_and_check_invalid_content()
23+
{
24+
const string content = "dummy contents";
25+
26+
var exception = Assert.Throws<ActionResultAssertionException>(() => _controller.WithCallTo(c => c.Content()).ShouldReturnContent(content));
27+
28+
Assert.That(exception.Message, Is.EqualTo(string.Format("Expected content to be \"{0}\", but instead was \"{1}\".", content, ControllerResultTestController.TextualContent)));
29+
}
30+
31+
[Test]
32+
public void Check_for_content_result_and_check_content_and_check_content_type()
33+
{
34+
_controller.WithCallTo(c => c.Content()).ShouldReturnContent(ControllerResultTestController.TextualContent, ControllerResultTestController.ContentType);
35+
}
36+
37+
[Test]
38+
public void Check_for_content_result_and_check_content_and_check_invalid_content_type()
39+
{
40+
const string contentType = "application/dummy";
41+
42+
var exception = Assert.Throws<ActionResultAssertionException>(() => _controller.WithCallTo(c => c.Content()).ShouldReturnContent(ControllerResultTestController.TextualContent, contentType));
43+
44+
Assert.That(exception.Message, Is.EqualTo(string.Format("Expected content type to be \"{0}\", but instead was \"{1}\".", contentType, ControllerResultTestController.ContentType)));
45+
}
46+
47+
[Test]
48+
public void Check_for_content_result_and_check_content_and_check_content_type_and_check_content_encoding()
49+
{
50+
_controller.WithCallTo(c => c.Content()).ShouldReturnContent(ControllerResultTestController.TextualContent, ControllerResultTestController.ContentType, ControllerResultTestController.TextualContentEncoding);
51+
}
52+
53+
[Test]
54+
public void Check_for_content_result_and_check_content_and_check_content_type_and_check_invalid_content_encoding()
55+
{
56+
var encoding = Encoding.Unicode;
57+
58+
var exception = Assert.Throws<ActionResultAssertionException>(() => _controller.WithCallTo(c => c.Content()).ShouldReturnContent(ControllerResultTestController.TextualContent, ControllerResultTestController.ContentType, encoding));
59+
60+
Assert.That(exception.Message, Is.EqualTo(string.Format("Expected encoding to be equal to {0}, but instead was {1}.", encoding.EncodingName, ControllerResultTestController.TextualContentEncoding.EncodingName)));
61+
}
62+
63+
[Test]
64+
public void Check_for_content_result_and_check_invalid_content_and_check_invalid_content_type_and_check_invalid_encoding()
65+
{
66+
const string contentType = "application/dummy";
67+
const string content = "dumb";
68+
Encoding encoding = Encoding.Unicode;
69+
70+
var exception = Assert.Throws<ActionResultAssertionException>(() => _controller.WithCallTo(c => c.Content()).ShouldReturnContent(content, contentType, encoding));
71+
72+
// Assert that the content type validation occurs before that of the actual content.
73+
Assert.That(exception.Message.Contains("content type"));
74+
}
75+
76+
[Test]
77+
public void Emit_readable_error_message_when_the_actual_content_encoding_has_not_been_specified()
78+
{
79+
var exception = Assert.Throws<ActionResultAssertionException>(() => _controller.WithCallTo(c => c.ContentWithoutEncodingSpecified()).ShouldReturnContent(encoding: ControllerResultTestController.TextualContentEncoding));
80+
81+
Assert.That(exception.Message, Is.EqualTo(string.Format("Expected encoding to be equal to {0}, but instead was null.", ControllerResultTestController.TextualContentEncoding.EncodingName)));
82+
}
83+
}
84+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using NUnit.Framework;
2+
3+
namespace TestStack.FluentMVCTesting.Tests
4+
{
5+
partial class ControllerResultTestShould
6+
{
7+
[Test]
8+
public void Check_for_empty_result()
9+
{
10+
_controller.WithCallTo(c => c.EmptyResult()).ShouldReturnEmptyResult();
11+
}
12+
}
13+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using NUnit.Framework;
2+
using TestStack.FluentMVCTesting.Tests.TestControllers;
3+
4+
namespace TestStack.FluentMVCTesting.Tests
5+
{
6+
partial class ControllerResultTestShould
7+
{
8+
[Test]
9+
public void Allow_the_object_that_is_returned_to_be_checked()
10+
{
11+
_controller.WithCallTo(c => c.Json()).ShouldReturnJson(d => Assert.That(d, Is.EqualTo(ControllerResultTestController.JsonValue)));
12+
}
13+
}
14+
}

‎TestStack.FluentMVCTesting.Tests/TestStack.FluentMVCTesting.Tests.csproj‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,18 @@
8282
</ItemGroup>
8383
<ItemGroup>
8484
<Compile Include="AsyncControllerTests.cs" />
85+
<Compile Include="ControllerResultTestTests\ShouldGiveHttpStatusTests.cs" />
86+
<Compile Include="ControllerResultTestTests\ShouldRedirectToTests.cs" />
87+
<Compile Include="ControllerResultTestTests\ShouldRenderFileTests.cs" />
88+
<Compile Include="ControllerResultTestTests\ShouldRenderViewTests.cs" />
89+
<Compile Include="ControllerResultTestTests\ShouldReturnEmptyResultTests.cs" />
90+
<Compile Include="ControllerResultTestTests\ShouldReturnJsonTests.cs" />
91+
<Compile Include="ControllerResultTestTests\ShouldReturnContentTests.cs" />
8592
<Compile Include="RouteValueDictionaryExtensionsTests.cs" />
8693
<Compile Include="TempDataResultTest.cs" />
8794
<Compile Include="TestControllers\AsyncController.cs" />
8895
<Compile Include="ControllerExtensionsTests.cs" />
89-
<Compile Include="ControllerResultTestTests.cs" />
96+
<Compile Include="ControllerResultTestTests\ControllerResultTestTests.cs" />
9097
<Compile Include="ModelTestTests.cs" />
9198
<Compile Include="ModelErrorTestTests.cs" />
9299
<Compile Include="Properties\AssemblyInfo.cs" />
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=ControllerResultTestTests/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

‎TestStack.FluentMvcTesting/ControllerResultTest.cs‎

Lines changed: 0 additions & 436 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System.Web.Mvc;
2+
3+
namespace TestStack.FluentMVCTesting
4+
{
5+
public partial class ControllerResultTest<T> where T : Controller
6+
{
7+
private readonly T _controller;
8+
private readonly string _actionName;
9+
private readonly ActionResult _actionResult;
10+
11+
private void ValidateActionReturnType<TActionResult>() where TActionResult : ActionResult
12+
{
13+
var castedActionResult = _actionResult as TActionResult;
14+
15+
if (_actionResult == null)
16+
throw new ActionResultAssertionException(string.Format("Received null action result when expecting {0}.", typeof(TActionResult).Name));
17+
18+
if (castedActionResult == null)
19+
throw new ActionResultAssertionException(
20+
string.Format("Expected action result to be a {0}, but instead received a {1}.",
21+
typeof(TActionResult).Name, _actionResult.GetType().Name
22+
)
23+
);
24+
}
25+
26+
public ControllerResultTest(T controller, string actionName, ActionResult actionResult)
27+
{
28+
_controller = controller;
29+
_actionName = actionName;
30+
_actionResult = actionResult;
31+
}
32+
}
33+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System.Net;
2+
using System.Web.Mvc;
3+
4+
namespace TestStack.FluentMVCTesting
5+
{
6+
public partial class ControllerResultTest<T>
7+
{
8+
public void ShouldGiveHttpStatus()
9+
{
10+
ValidateActionReturnType<HttpStatusCodeResult>();
11+
}
12+
13+
public void ShouldGiveHttpStatus(int status)
14+
{
15+
ValidateActionReturnType<HttpStatusCodeResult>();
16+
17+
var statusCodeResult = (HttpStatusCodeResult)_actionResult;
18+
19+
if (statusCodeResult.StatusCode != status)
20+
throw new ActionResultAssertionException(string.Format("Expected HTTP status code to be '{0}', but instead received a '{1}'.", status, statusCodeResult.StatusCode));
21+
}
22+
23+
public void ShouldGiveHttpStatus(HttpStatusCode status)
24+
{
25+
ShouldGiveHttpStatus((int)status);
26+
}
27+
}
28+
}
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
using System;
2+
using System.Linq.Expressions;
3+
using System.Reflection;
4+
using System.Text.RegularExpressions;
5+
using System.Web.Mvc;
6+
using System.Web.Routing;
7+
8+
namespace TestStack.FluentMVCTesting
9+
{
10+
public partial class ControllerResultTest<T>
11+
{
12+
public void ShouldRedirectTo(string url)
13+
{
14+
ValidateActionReturnType<RedirectResult>();
15+
var redirectResult = (RedirectResult)_actionResult;
16+
17+
if (redirectResult.Url != url)
18+
throw new ActionResultAssertionException(string.Format("Expected redirect to URL '{0}', but instead was given a redirect to URL '{1}'.", url, redirectResult.Url));
19+
}
20+
21+
public RouteValueDictionary ShouldRedirectToRoute(string route)
22+
{
23+
ValidateActionReturnType<RedirectToRouteResult>();
24+
var redirectResult = (RedirectToRouteResult)_actionResult;
25+
26+
if (redirectResult.RouteName != route)
27+
throw new ActionResultAssertionException(string.Format("Expected redirect to route '{0}', but instead was given a redirect to route '{1}'.", route, redirectResult.RouteName));
28+
29+
return redirectResult.RouteValues;
30+
}
31+
32+
public RouteValueDictionary ShouldRedirectTo(Func<T, Func<ActionResult>> actionRedirectedTo)
33+
{
34+
return ShouldRedirectTo(actionRedirectedTo(_controller).Method);
35+
}
36+
37+
public RouteValueDictionary ShouldRedirectTo(Func<T, Func<int, ActionResult>> actionRedirectedTo)
38+
{
39+
return ShouldRedirectTo(actionRedirectedTo(_controller).Method);
40+
}
41+
42+
public RouteValueDictionary ShouldRedirectTo<T1>(Func<T, Func<T1, ActionResult>> actionRedirectedTo)
43+
{
44+
return ShouldRedirectTo(actionRedirectedTo(_controller).Method);
45+
}
46+
47+
public RouteValueDictionary ShouldRedirectTo<T1, T2>(Func<T, Func<T1, T2, ActionResult>> actionRedirectedTo)
48+
{
49+
return ShouldRedirectTo(actionRedirectedTo(_controller).Method);
50+
}
51+
52+
public RouteValueDictionary ShouldRedirectTo<T1, T2, T3>(Func<T, Func<T1, T2, T3, ActionResult>> actionRedirectedTo)
53+
{
54+
return ShouldRedirectTo(actionRedirectedTo(_controller).Method);
55+
}
56+
57+
public RouteValueDictionary ShouldRedirectTo(Expression<Action<T>> actionRedirectedTo)
58+
{
59+
var methodCall = (MethodCallExpression)actionRedirectedTo.Body;
60+
return ShouldRedirectTo(methodCall.Method);
61+
}
62+
63+
public RouteValueDictionary ShouldRedirectTo(MethodInfo method, RouteValueDictionary expectedValues = null)
64+
{
65+
ValidateActionReturnType<RedirectToRouteResult>();
66+
67+
var controllerName = new Regex(@"Controller$").Replace(typeof(T).Name, "");
68+
var actionName = method.Name;
69+
var redirectResult = (RedirectToRouteResult)_actionResult;
70+
71+
if (redirectResult.RouteValues.ContainsKey("Controller") && redirectResult.RouteValues["Controller"].ToString() != controllerName)
72+
throw new ActionResultAssertionException(string.Format("Expected redirect to controller '{0}', but instead was given a redirect to controller '{1}'.", controllerName, redirectResult.RouteValues["Controller"]));
73+
74+
if (!redirectResult.RouteValues.ContainsKey("Action"))
75+
throw new ActionResultAssertionException(string.Format("Expected redirect to action '{0}', but instead was given a redirect without an action.", actionName));
76+
77+
if (redirectResult.RouteValues["Action"].ToString() != actionName)
78+
throw new ActionResultAssertionException(string.Format("Expected redirect to action '{0}', but instead was given a redirect to action '{1}'.", actionName, redirectResult.RouteValues["Action"]));
79+
80+
if (expectedValues == null)
81+
return redirectResult.RouteValues;
82+
83+
foreach (var expectedRouteValue in expectedValues)
84+
{
85+
object actualValue;
86+
if (!redirectResult.RouteValues.TryGetValue(expectedRouteValue.Key, out actualValue))
87+
{
88+
throw new ActionResultAssertionException(string.Format("Expected redirect to have parameter '{0}', but it did not.", expectedRouteValue.Key));
89+
}
90+
if (actualValue.ToString() != expectedRouteValue.Value.ToString())
91+
{
92+
throw new ActionResultAssertionException(
93+
string.Format("Expected parameter '{0}' to have value '{1}', but instead was given value '{2}'."
94+
, expectedRouteValue.Key
95+
, expectedRouteValue.Value
96+
, actualValue
97+
));
98+
}
99+
}
100+
101+
return redirectResult.RouteValues;
102+
}
103+
104+
public RouteValueDictionary ShouldRedirectTo<TController>(Expression<Action<TController>> actionRedirectedTo) where TController : Controller
105+
{
106+
var methodCall = (MethodCallExpression)actionRedirectedTo.Body;
107+
return ShouldRedirectTo<TController>(methodCall.Method);
108+
}
109+
110+
public RouteValueDictionary ShouldRedirectTo<TController>(MethodInfo methodInfo) where TController : Controller
111+
{
112+
ValidateActionReturnType<RedirectToRouteResult>();
113+
114+
var controllerName = new Regex(@"Controller$").Replace(typeof(TController).Name, "");
115+
var actionName = methodInfo.Name;
116+
117+
var redirectResult = (RedirectToRouteResult)_actionResult;
118+
119+
if (redirectResult.RouteValues["Controller"] == null)
120+
throw new ActionResultAssertionException(string.Format("Expected redirect to action '{0}' in '{1}' controller, but instead was given redirect to action '{2}' within the same controller.", actionName, controllerName, redirectResult.RouteValues["Action"]));
121+
122+
if (redirectResult.RouteValues["Controller"].ToString() != controllerName)
123+
throw new ActionResultAssertionException(string.Format("Expected redirect to controller '{0}', but instead was given a redirect to controller '{1}'.", controllerName, redirectResult.RouteValues["Controller"]));
124+
125+
if (redirectResult.RouteValues["Action"].ToString() != actionName)
126+
throw new ActionResultAssertionException(string.Format("Expected redirect to action '{0}', but instead was given a redirect to action '{1}'.", actionName, redirectResult.RouteValues["Action"]));
127+
128+
return redirectResult.RouteValues;
129+
}
130+
}
131+
}
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
using System.IO;
2+
using System.Linq;
3+
using System.Text;
4+
using System.Web.Mvc;
5+
6+
namespace TestStack.FluentMVCTesting
7+
{
8+
public partial class ControllerResultTest<T>
9+
{
10+
private static void EnsureContentTypeIsSame(string actual, string expected)
11+
{
12+
if (expected == null) return;
13+
if (actual != expected)
14+
{
15+
throw new ActionResultAssertionException(string.Format(
16+
"Expected file to be of content type '{0}', but instead was given '{1}'.", expected, actual));
17+
}
18+
}
19+
20+
private static byte[] ConvertStreamToArray(Stream stream)
21+
{
22+
using (var memoryStream = new MemoryStream())
23+
{
24+
stream.CopyTo(memoryStream);
25+
stream.Position = 0;
26+
return memoryStream.ToArray();
27+
}
28+
}
29+
30+
public FileResult ShouldRenderAnyFile(string contentType = null)
31+
{
32+
ValidateActionReturnType<FileResult>();
33+
var fileResult = (FileResult)_actionResult;
34+
35+
EnsureContentTypeIsSame(fileResult.ContentType, contentType);
36+
37+
return fileResult;
38+
}
39+
40+
public FileContentResult ShouldRenderFileContents(byte[] contents = null, string contentType = null)
41+
{
42+
ValidateActionReturnType<FileContentResult>();
43+
var fileResult = (FileContentResult)_actionResult;
44+
45+
EnsureContentTypeIsSame(fileResult.ContentType, contentType);
46+
47+
if (contents != null && !fileResult.FileContents.SequenceEqual(contents))
48+
{
49+
throw new ActionResultAssertionException(string.Format(
50+
"Expected file contents to be equal to [{0}], but instead was given [{1}].",
51+
string.Join(", ", contents),
52+
string.Join(", ", fileResult.FileContents)));
53+
}
54+
55+
return fileResult;
56+
}
57+
58+
public FileContentResult ShouldRenderFileContents(string contents, string contentType = null, Encoding encoding = null)
59+
{
60+
ValidateActionReturnType<FileContentResult>();
61+
var fileResult = (FileContentResult)_actionResult;
62+
63+
EnsureContentTypeIsSame(fileResult.ContentType, contentType);
64+
65+
if (encoding == null)
66+
encoding = Encoding.UTF8;
67+
68+
var reconstitutedText = encoding.GetString(fileResult.FileContents);
69+
if (contents != reconstitutedText)
70+
{
71+
throw new ActionResultAssertionException(string.Format(
72+
"Expected file contents to be \"{0}\", but instead was \"{1}\".",
73+
contents,
74+
reconstitutedText));
75+
}
76+
77+
return fileResult;
78+
}
79+
80+
public FileStreamResult ShouldRenderFileStream(byte[] content, string contentType = null)
81+
{
82+
var reconstitutedStream = new MemoryStream(content);
83+
return ShouldRenderFileStream(reconstitutedStream, contentType);
84+
}
85+
86+
public FileStreamResult ShouldRenderFileStream(Stream stream = null, string contentType = null)
87+
{
88+
ValidateActionReturnType<FileStreamResult>();
89+
var fileResult = (FileStreamResult)_actionResult;
90+
91+
EnsureContentTypeIsSame(fileResult.ContentType, contentType);
92+
93+
if (stream != null)
94+
{
95+
byte[] expected = ConvertStreamToArray(stream);
96+
byte[] actual = ConvertStreamToArray(fileResult.FileStream);
97+
98+
if (!expected.SequenceEqual(actual))
99+
{
100+
throw new ActionResultAssertionException(string.Format(
101+
"Expected file contents to be equal to [{0}], but instead was given [{1}].",
102+
string.Join(", ", expected),
103+
string.Join(", ", actual)));
104+
}
105+
}
106+
107+
return fileResult;
108+
}
109+
110+
public FileStreamResult ShouldRenderFileStream(string contents, string contentType = null, Encoding encoding = null)
111+
{
112+
ValidateActionReturnType<FileStreamResult>();
113+
var fileResult = (FileStreamResult)_actionResult;
114+
115+
EnsureContentTypeIsSame(fileResult.ContentType, contentType);
116+
117+
if (encoding == null)
118+
encoding = Encoding.UTF8;
119+
120+
var reconstitutedText = encoding.GetString(ConvertStreamToArray(fileResult.FileStream));
121+
if (contents != reconstitutedText)
122+
{
123+
throw new ActionResultAssertionException(string.Format(
124+
"Expected file contents to be \"{0}\", but instead was \"{1}\".",
125+
contents,
126+
reconstitutedText));
127+
}
128+
129+
return fileResult;
130+
}
131+
132+
public FilePathResult ShouldRenderFilePath(string fileName = null, string contentType = null)
133+
{
134+
ValidateActionReturnType<FilePathResult>();
135+
var fileResult = (FilePathResult)_actionResult;
136+
137+
EnsureContentTypeIsSame(fileResult.ContentType, contentType);
138+
139+
if (fileName != null && fileName != fileResult.FileName)
140+
{
141+
throw new ActionResultAssertionException(string.Format(
142+
"Expected file name to be '{0}', but instead was given '{1}'.",
143+
fileName,
144+
fileResult.FileName));
145+
}
146+
147+
return fileResult;
148+
}
149+
}
150+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using System.Web.Mvc;
2+
3+
namespace TestStack.FluentMVCTesting
4+
{
5+
public partial class ControllerResultTest<T>
6+
{
7+
private ViewResultTest ShouldRenderViewResult<TViewResult>(string viewName) where TViewResult : ViewResultBase
8+
{
9+
ValidateActionReturnType<TViewResult>();
10+
11+
var viewResult = (TViewResult)_actionResult;
12+
13+
if (viewResult.ViewName != viewName && (viewName != _actionName || viewResult.ViewName != ""))
14+
{
15+
throw new ActionResultAssertionException(string.Format("Expected result view to be '{0}', but instead was given '{1}'.", viewName, viewResult.ViewName == "" ? _actionName : viewResult.ViewName));
16+
}
17+
18+
return new ViewResultTest(viewResult, _controller);
19+
}
20+
21+
public ViewResultTest ShouldRenderView(string viewName)
22+
{
23+
return ShouldRenderViewResult<ViewResult>(viewName);
24+
}
25+
26+
public ViewResultTest ShouldRenderPartialView(string viewName)
27+
{
28+
return ShouldRenderViewResult<PartialViewResult>(viewName);
29+
}
30+
31+
public ViewResultTest ShouldRenderDefaultView()
32+
{
33+
return ShouldRenderView(_actionName);
34+
}
35+
36+
public ViewResultTest ShouldRenderDefaultPartialView()
37+
{
38+
return ShouldRenderPartialView(_actionName);
39+
}
40+
}
41+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using System.Text;
2+
using System.Web.Mvc;
3+
4+
namespace TestStack.FluentMVCTesting
5+
{
6+
public partial class ControllerResultTest<T>
7+
{
8+
public ContentResult ShouldReturnContent(string content = null, string contentType = null, Encoding encoding = null)
9+
{
10+
ValidateActionReturnType<ContentResult>();
11+
var contentResult = (ContentResult)_actionResult;
12+
13+
if (contentType != null && contentType != contentResult.ContentType)
14+
{
15+
throw new ActionResultAssertionException(string.Format(
16+
"Expected content type to be \"{0}\", but instead was \"{1}\".",
17+
contentType,
18+
contentResult.ContentType));
19+
}
20+
21+
if (content != null && content != contentResult.Content)
22+
{
23+
throw new ActionResultAssertionException(string.Format(
24+
"Expected content to be \"{0}\", but instead was \"{1}\".",
25+
content,
26+
contentResult.Content));
27+
}
28+
29+
if (encoding != null && encoding != contentResult.ContentEncoding)
30+
{
31+
throw new ActionResultAssertionException(string.Format(
32+
"Expected encoding to be equal to {0}, but instead was {1}.",
33+
encoding.EncodingName,
34+
contentResult.ContentEncoding != null ? contentResult.ContentEncoding.EncodingName : "null"));
35+
}
36+
37+
return contentResult;
38+
}
39+
}
40+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System.Web.Mvc;
2+
3+
namespace TestStack.FluentMVCTesting
4+
{
5+
public partial class ControllerResultTest<T>
6+
{
7+
public void ShouldReturnEmptyResult()
8+
{
9+
ValidateActionReturnType<EmptyResult>();
10+
}
11+
}
12+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using System.Web.Mvc;
3+
4+
namespace TestStack.FluentMVCTesting
5+
{
6+
public partial class ControllerResultTest<T>
7+
{
8+
public void ShouldReturnJson()
9+
{
10+
ValidateActionReturnType<JsonResult>();
11+
}
12+
13+
public void ShouldReturnJson(Action<dynamic> assertion)
14+
{
15+
ValidateActionReturnType<JsonResult>();
16+
var jsonResult = (JsonResult)_actionResult;
17+
assertion(jsonResult.Data);
18+
}
19+
}
20+
}

‎TestStack.FluentMvcTesting/Exceptions.cs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace TestStack.FluentMVCTesting
44
{
5-
65
public class TempDataAssertionException : Exception
76
{
87
public TempDataAssertionException(string message) : base(message) { }

‎TestStack.FluentMvcTesting/RouteValueDictionaryExtension.cs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System.Collections.Generic;
2-
using System.Web.Routing;
1+
using System.Web.Routing;
32

43
namespace TestStack.FluentMVCTesting
54
{

‎TestStack.FluentMvcTesting/TestStack.FluentMVCTesting.csproj‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,16 @@
7676
<Reference Include="System.Xml" />
7777
</ItemGroup>
7878
<ItemGroup>
79+
<Compile Include="ControllerResultTest\ShouldGiveHttpStatus.cs" />
80+
<Compile Include="ControllerResultTest\ShouldRedirectTo.cs" />
81+
<Compile Include="ControllerResultTest\ShouldRenderFile.cs" />
82+
<Compile Include="ControllerResultTest\ShouldRenderView.cs" />
83+
<Compile Include="ControllerResultTest\ShouldReturnContent.cs" />
84+
<Compile Include="ControllerResultTest\ShouldReturnEmptyResult.cs" />
85+
<Compile Include="ControllerResultTest\ShouldReturnJson.cs" />
7986
<Compile Include="RouteValueDictionaryExtension.cs" />
8087
<Compile Include="ControllerExtensions.cs" />
81-
<Compile Include="ControllerResultTest.cs" />
88+
<Compile Include="ControllerResultTest\ControllerResultTest.cs" />
8289
<Compile Include="Exceptions.cs" />
8390
<Compile Include="ModelErrorTest.cs" />
8491
<Compile Include="ModelTest.cs" />
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=ControllerResultTest/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

0 commit comments

Comments
 (0)
Please sign in to comment.