-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@f.PartialFor, @f.Partial, @s.PartialFor, @s.Partial #132
Conversation
|
||
@using (var f = Html.BeginChameleonForm()) | ||
{ | ||
@f.Partial("_ParentPartial") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This view shows all the usages:
@f.Partial(...) / @f.PartialFor(m => m, ...)
@f.PartialFor(m => m.Child, ...)
@s.Partial(...) / @s.PartialFor(m => m, ...)
@s.PartialFor(m => m.Child, ...)
You thrown away all that stuff with expression rewriting. Good. It was really overcomplicated. |
I still needed the Combine method you wrote though. Did you write that from scratch or pull from stack overflow by the way? I'd like to attribute of if the latter so we can find the original source.
|
It was from stackoverflow. See this questions: |
I've added test coverage now. Had to do it in the Acceptance Tests project. Only thing I haven't put in is the I'm inclined to get this in and leave that as an exercise for someone else (@zabulus or otherwise) since I don't think it's essential. @MattDavies can you cast your eye over and merge if happy? |
FYI This drops the code coverage stats heaps, but the code is actually covered due to the Acceptance Test |
@@ -4,6 +4,19 @@ ChameleonForms Breaking Changes | |||
Version 2.0.0 | |||
============= | |||
|
|||
Deprecated `WithoutLabel` method on `IFieldConfiguration`. It still works (for now), but the method has been marked with the `[Obsolete]` attribute. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is from a previous PR, but I noticed that it was missing so added in.
I suspect we can release v2 after this PR is merged in. Thoughts @MattDavies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to get my other WIP PR merged as well, but not sure when I'll have time to finish it.
I've added a bunch of tweaks I called out. Only thing left is to add some doco to the wiki after it's merged |
wiki entry done |
/// Loading partial views is very difficult to test by unit testing. | ||
/// </summary> | ||
[UseReporter(typeof(DiffReporter))] | ||
public class PartialForTests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think also need to add submit test, and check that POST binding works as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
Let's do it in a separate PR though. I'm happy enough that it will postback ok in reviewing the approval test.
On 12 Oct 2015, at 5:28 pm, zabulus [email protected] wrote:
In ChameleonForms.AcceptanceTests/PartialForTests.cs:
+using System.IO;
+using System.Net.Http;
+using System.Text.RegularExpressions;
+using ApprovalTests.Html;
+using ApprovalTests.Reporters;
+using NUnit.Framework;
+using OpenQA.Selenium;
+using OpenQA.Selenium.Support.UI;
+
+namespace ChameleonForms.AcceptanceTests
+{
///
/// Loading partial views is very difficult to test by unit testing.
///
[UseReporter(typeof(DiffReporter))]
public class PartialForTests
I think also need to add submit test, and check that POST binding works as expected.—
Reply to this email directly or view it on GitHub.
@f.PartialFor, @f.Partial, @s.PartialFor, @s.Partial
Alternative implementation to #113
I wanted to try and understand some of the complexity in #113 and why it's there. There were a few things I had to make simpler, but all in all most of the structure from #113 has been retained.
Would be good to get a fresh pair of eyes on this @MattDavies @Royce
cc @zabulus