-
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Getting element access to break more consistent in long invocation ch…
…ains. (#967) * notes * Getting element access to break more consistently with invocations. closes #956 * Getting properties breaking consistent with invocations * Fixing more edge cases * some self review --------- Co-authored-by: Lasath Fernando <devel@lasath.org>
- Loading branch information
1 parent
dbc74ca
commit 4e4bb4d
Showing
8 changed files
with
119 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberChain_ArraysConsistent.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
var x = someLongNameField | ||
.CallMethod____________________________________() | ||
.AccessArray[1] | ||
.Property_______________; | ||
|
||
var x = someLongNameField | ||
.CallMethod____________________________________() | ||
.CallMethod(1) | ||
.Property_______________; | ||
|
||
new Action(AssertConfigurationIsValid) | ||
.ShouldThrow<AutoMapperConfigurationException>() | ||
.Errors[0] | ||
.UnmappedPropertyNames[0] | ||
.ShouldBe(nameof(Destination.Count)); |
33 changes: 33 additions & 0 deletions
33
Src/CSharpier.Tests/FormattingTests/TestFiles/cs/MemberChain_PropertiesConsistent.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
var someVariable = someObject | ||
.Property | ||
.CallMethod(someValue => someValue.SomeProperty == someOtherValue___________________________); | ||
|
||
var someVariable = someObject | ||
.Property() | ||
.CallMethod(someValue => someValue.SomeProperty == someOtherValue___________________________); | ||
|
||
var someVariable = someObject | ||
.Property | ||
.CallMethod(someValue => someValue.SomeProperty == someOtherValue___________________________) | ||
.CallMethod(); | ||
|
||
var someVariable = someObject | ||
.Property() | ||
.CallMethod(someValue => someValue.SomeProperty == someOtherValue___________________________) | ||
.CallMethod(); | ||
|
||
// TODO too hard to change this for now, will do it in https://github.com/belav/csharpier/issues/451 | ||
var someVariable = this.Property.CallMethod( | ||
someValue => someValue.SomeProperty == someOtherValue___________________________ | ||
); | ||
|
||
var someVariable = this.Property() | ||
.CallMethod(someValue => someValue.SomeProperty == someOtherValue___________________________); | ||
|
||
var someVariable = this.Property | ||
.CallMethod(someValue => someValue.SomeProperty == someOtherValue___________________________) | ||
.CallMethod(); | ||
|
||
var someVariable = this.Property() | ||
.CallMethod(someValue => someValue.SomeProperty == someOtherValue___________________________) | ||
.CallMethod(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters