You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: BREAKING_CHANGES.md
+22-2Lines changed: 22 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ You can read the original problem specification and discussion [here](https://g
23
23
24
24
If your project has been impacted by this particular breaking change, you might consider reevaluate the correctness of the affected tests.
25
25
26
-
## Error Messages
26
+
## Error Message Quotes
27
27
28
28
Some error messages surrounded actual values in double quotes. Others surrounded the values in single quotes. In version 3.0.0 *all* values are surrounded in single quotes.
29
29
@@ -33,7 +33,27 @@ Consistency.
33
33
34
34
### Fix
35
35
36
-
Amend all effected tests to expect single quotes instead of double quotes.
36
+
Amend any affected tests to expect single quotes instead of double quotes.
37
+
38
+
## Error Message Lambda Expression
39
+
40
+
In error messages, lambda expressions arguments are now surrounded in a pair of parentheses. For example:
41
+
42
+
... to pass the given condition (model => (model.Property1 != null))
43
+
44
+
will now look like this:
45
+
46
+
... to pass the given condition ((model) => (model.Property1 != null))
47
+
48
+
As you can see, the argument called `model` is now surrounded in parentheses.
49
+
50
+
###Reason
51
+
52
+
FluentMVCTesting now uses [ExpressionToString](https://github.com/JakeGinnivan/ExpressionToString) to humanize expression trees. ExpressionToString surrounds arguments in parentheses.
53
+
54
+
###Fix
55
+
56
+
Amend any affected tests to expect lambda expression arguments to be surrounded in parentheses.
Assert.That(exception.Message,Is.EqualTo(string.Format("Expected view model {{\"Property1\":\"{0}\",\"Property2\":{1}}} to pass the given condition (m => (m.Property1 == null)), but it failed.",_model.Property1,_model.Property2)));
75
+
Assert.That(exception.Message,Is.EqualTo(string.Format("Expected view model {{\"Property1\":\"{0}\",\"Property2\":{1}}} to pass the given condition ((m) => (m.Property1 == null)), but it failed.",_model.Property1,_model.Property2)));
76
76
}
77
77
78
78
[Test]
@@ -81,7 +81,7 @@ public void Check_for_invalid_model_using_predicate_with_conditional_or()
Assert.That(exception.Message,Is.EqualTo(string.Format("Expected view model {{\"Property1\":\"{0}\",\"Property2\":{1}}} to pass the given condition (m => ((m.Property1 == null) || (m.Property2 == 1))), but it failed.",_model.Property1,_model.Property2)));
84
+
Assert.That(exception.Message,Is.EqualTo(string.Format("Expected view model {{\"Property1\":\"{0}\",\"Property2\":{1}}} to pass the given condition ((m) => ((m.Property1 == null) || (m.Property2 == 1))), but it failed.",_model.Property1,_model.Property2)));
85
85
}
86
86
87
87
[Test]
@@ -91,7 +91,18 @@ public void Check_for_invalid_model_using_predicate_with_primitive_operand()
Assert.That(exception.Message,Is.EqualTo(string.Format("Expected view model \"{0}\" to pass the given condition (m => (m == \"ab\")), but it failed.",_viewResult.ViewData.Model)));
94
+
Assert.That(exception.Message,Is.EqualTo(string.Format("Expected view model \"{0}\" to pass the given condition ((m) => (m == \"ab\")), but it failed.",_viewResult.ViewData.Model)));
Assert.That(exception.Message,Is.EqualTo(string.Format("Expected view model \"{0}\" to pass the given condition ((m) => (m == capturedOuterVar)), but it failed.",_viewResult.ViewData.Model)));
0 commit comments