Add tests for System.ComponentModel#12238
Conversation
|
/cc @danmosemsft @weshaggard |
| Assert.True (ibl.SupportsChangeNotification, "7"); | ||
| Assert.False (ibl.SupportsSearching, "8"); | ||
| Assert.False (ibl.SupportsSorting, "9"); | ||
| Assert.False (((IRaiseItemChangedEvents)l).RaisesItemChangedEvents, "10"); |
There was a problem hiding this comment.
Nit: instead of a number, can we use the name of the thing being tested? e.g.
Assert.True(l.AllowEdit, nameof(l.AllowEdit));?
Same comment applies elsewhere.
| Assert.True (l.RaiseListChangedEvents, "4"); | ||
|
|
||
| Assert.False (ibl.IsSorted, "5"); | ||
| Assert.Equal (ibl.SortDirection, ListSortDirection.Ascending); |
There was a problem hiding this comment.
Nit: in Assert.Equal, the first arg is the expected value and the second is the actual value, so these should be swapped
| Assert.True (l.RaiseListChangedEvents, "4"); | ||
|
|
||
| Assert.False (ibl.IsSorted, "5"); | ||
| Assert.Equal (ibl.SortDirection, ListSortDirection.Ascending); |
There was a problem hiding this comment.
Ditto on swapping the order
| Assert.True (l.RaiseListChangedEvents, "4"); | ||
|
|
||
| Assert.False (ibl.IsSorted, "5"); | ||
| Assert.Equal (ibl.SortDirection, ListSortDirection.Ascending); |
There was a problem hiding this comment.
Nit: ditto on swapping the order
| Assert.True (l.RaiseListChangedEvents, "4"); | ||
|
|
||
| Assert.False (ibl.IsSorted, "5"); | ||
| Assert.Equal (ibl.SortDirection, ListSortDirection.Ascending); |
There was a problem hiding this comment.
Nit: ditto on swapping the order
| Assert.Null (compB.Site); | ||
| } | ||
|
|
||
| [Fact] // bug #522474 |
There was a problem hiding this comment.
Same nits about bug numbers as earlier.
| try { | ||
| object context = stack [-5]; | ||
| Assert.False(true); | ||
| } catch (ArgumentOutOfRangeException ex) { |
There was a problem hiding this comment.
All of the tests that follow this pattern should be switched to use Assert.Throws
There was a problem hiding this comment.
I fixed all of them that did not check the caught exception.
There was a problem hiding this comment.
I fixed all of them that did not check the caught exception.
You can still do that with Assert.Throws, which returns the caught exception.
There was a problem hiding this comment.
Nice! I didn't know about that overload! :)
|
|
||
| result = converter.ConvertToString (null, CultureInfo.InvariantCulture, | ||
| new CultureInfo ("nl-BE")); | ||
| Assert.Equal ("nl-BE", result); |
There was a problem hiding this comment.
Nit: we don't actually need the local in cases like these, e.g.
Assert.Equal ("nl-BE", converter.ConvertToString(null, CultureInfo.InvariantCulture, new CultureInfo("nl-BE")));| public override string EnglishName { | ||
| get { return "english"; } | ||
| } | ||
| } |
There was a problem hiding this comment.
Nit: things like this can be simplified with expression-bodied members, e.g.
public override string EnglishName => "english";| { | ||
| public class InstanceDescriptorTest { | ||
|
|
||
| private const string url = "http://www.mono-project.com/"; |
| public class BindingListTest | ||
| { | ||
| [Fact] | ||
| public void BindingListDefaults () |
There was a problem hiding this comment.
Can we cleanup the formatting to match the CoreFX coding style? Mono code style places a space before parens, which would ideally be removed here. Applies throughout.
| using System.ComponentModel.Design.Serialization; | ||
| using System.Collections.Generic; | ||
| using Xunit; | ||
| using System.Reflection; |
There was a problem hiding this comment.
Nit: "Remove and Sort usings". Haven't looked at the other files, but applies to those too, if needed.
| @@ -0,0 +1,681 @@ | |||
| // Licensed to the .NET Foundation under one or more agreements. | |||
| // See the LICENSE file in the project root for more information. | |||
|
|
|||
There was a problem hiding this comment.
I wanted to have a visual differentiator between the license header and the slightly different copyright line added.
There was a problem hiding this comment.
Changed this one more time :). Thanks for reviewing!
6ae2579 to
356f2fd
Compare
|
@dotnet-bot please test Innerloop CentOS7.1 Debug Build and Test (exit code 139) |
| Assert.Equal(CultureInfo.InvariantCulture, c); | ||
| } | ||
|
|
||
| [ActiveIssue(11611, Xunit.PlatformID.AnyUnix)] |
There was a problem hiding this comment.
PlatformID has been renamed TestPlatforms. It would be good if it was renamed here before merging. See #12284.
e.g. [ActiveIssue(11611, TestPlatforms.AnyUnix)]
| "nl-B"); | ||
| } | ||
|
|
||
| [ActiveIssue(11611, Xunit.PlatformID.AnyUnix)] |
There was a problem hiding this comment.
PlatformID has been renamed TestPlatforms. It would be good if it was renamed here before merging. See #12284.
e.g. [ActiveIssue(11611, TestPlatforms.AnyUnix)]
| Assert.True(converter.CanConvertTo(typeof(InstanceDescriptor))); | ||
| } | ||
|
|
||
| [ActiveIssue(11611, Xunit.PlatformID.AnyUnix)] |
There was a problem hiding this comment.
PlatformID has been renamed TestPlatforms. It would be good if it was renamed here before merging. See #12284.
e.g. [ActiveIssue(11611, TestPlatforms.AnyUnix)]
There was a problem hiding this comment.
Thank you! Will do!
356f2fd to
1ac157b
Compare
|
@dotnet-bot please test Innerloop CentOS7.1 Debug Build and Test (machine setup issue) |
|
@justinvp, @stephentoub let me know if you have any more feedback! |
|
Thanks, Alex. I don't need to review again. |
|
Same here. Thanks. |
ad2dfa5 to
3b8b25a
Compare
|
Argh... |
79f7595 to
3b8b25a
Compare
These were ported over from Mono.
3b8b25a to
7564675
Compare
|
@dotnet-bot please test Innerloop CentOS7.1 Release Build and Test (machine issue) |
|
@dotnet-bot please test Innerloop CentOS7.1 Debug Build and Test (machine issue) |
…oSystemComponentModel Add tests for System.ComponentModel Commit migrated from dotnet/corefx@795777a
These were ported over from Mono