Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Failed validation now invokes partial. Object graph injected into act…

…ion finder
  • Loading branch information...
commit 2e3d6fb6b8bb014a5f445ba0ab97670945a84c37 1 parent 3b10f37
@NTCoding authored
View
7 src/app/Web/Infrastructure/BehaviourGraphActionFinder.cs
@@ -6,7 +6,12 @@ namespace Web.Infrastructure
{
public class BehaviourGraphActionFinder : IActionFinder
{
- private BehaviorGraph graph;
+ private readonly BehaviorGraph graph;
+
+ public BehaviourGraphActionFinder(BehaviorGraph graph)
+ {
+ this.graph = graph;
+ }
public Type GetRequestModelTypeFor<T>(T inputModel)
{
View
2  src/app/Web/Infrastructure/Validation/NTCodingValidationBehaviour.cs
@@ -45,7 +45,7 @@ private void SetContextAndRedirectToGet(T inputModel, Notification notification)
request.Set(notification);
request.Set(new ValidatedInputModel<T>(inputModel) { FailedValidation = true });
- factory.BuildPartial(actionFinder.GetRequestModelTypeFor(inputModel)).Invoke();
+ factory.BuildPartial(actionFinder.GetRequestModelTypeFor(inputModel)).InvokePartial();
}
public void InvokePartial()
View
2  src/tests/Web.Tests/Infrastructure/Validation_behaviour_successful_validation_tests.cs
@@ -124,7 +124,7 @@ public void Sets_failed_validation_in_request()
[Test]
public void Redirects_to_get_action_using_partial()
{
- partial.AssertWasCalled(p => p.Invoke());
+ partial.AssertWasCalled(p => p.InvokePartial());
}
[Test]
Please sign in to comment.
Something went wrong with that request. Please try again.