Commit Graph
18 Commits
Author SHA1 Message Date
Daniel Harvey 252cdc5e95 Bulk updates of tests for AssertExtensions (dotnet/corefx#18491)
Bulk update to AssertExtensions.Throws for AOT support. This doesn't disable Assert.Throws.

Commit migrated from https://github.com/dotnet/corefx/commit/b43b4df2e0e2182154bb0f425cb4a61bc1269828
2017-04-18 09:52:02 -07:00
Alex Perovich fc4bb66b9f Fold or rename *.netstandard.cs files (dotnet/corefx#17697)
* Win32.Primitives

* System.Collections.Specialized

* System.Diagnostics.Process

* System.Globalization

* System.Globalization.Calendars

* System.IO

* System.IO.Compression

* System.IO.FileSystem

* System.IO.FileSystem.Watcher

* System.IO.Pipes

* System.Linq.Expressions

* System.Net.Primitives

* System.Net.Requests

* System.Net.Sockets

* System.Net.WebHeaderCollection

* System.ObjectModel

* System.Reflection

* System.Reflection.Emit

* System.Resources.ResourceManager

* System.Runtime

* System.Runtime.Extensions

* System.Runtime.Handles

* System.Runtime.InteropServices

* System.Security.Cryptography.X509Certificates

* System.Text.Encoding

* System.Text.Encoding.CodePages

* System.Threading

* System.Threading.Tasks

* System.Threading.Thread

* System.Threading.Timer

* System.ValueTuple


Commit migrated from https://github.com/dotnet/corefx/commit/023b6bdd6086271cbb6ca932c33d7783f8406062
2017-03-30 17:28:22 -05:00
Paul Harrington 79d26b7560 Fix typos: occurred/occurrence (dotnet/corefx#16459)
Commit migrated from https://github.com/dotnet/corefx/commit/94a4ddf3f8f04ef2dc0486afcb62ef873bec2530
2017-02-24 23:56:39 -08:00
Jose Perez Rodriguez 24a5aef91d Merge master into dev/eng
Commit migrated from https://github.com/dotnet/corefx/commit/a9dd06b73bdd71038217bb263decf2b7285fb8db
2017-01-12 10:09:09 -08:00
Tarek Mahmoud Sayed c41fdd41c2 Fix System.ObjectModel test to run on desktop
Commit migrated from https://github.com/dotnet/corefx/commit/8e72ff3d2429a164571168513ca8fb735e6e2bb0
2017-01-11 11:02:50 -08:00
Alex Perovich ae1810f29c Automated rename of tfm specific files
Commit migrated from https://github.com/dotnet/corefx/commit/ca330455c9b884ffcca5b8b98d28a129e2248fe6
2017-01-10 16:20:59 -08:00
Stephen Toub 795becd1e5 Add System.ObjectModel serialization
Commit migrated from https://github.com/dotnet/corefx/commit/bf824598e784551d693672d7758cc404288dfb86
2016-11-02 22:55:25 -04:00
Justin Van Patten ebf0f387b2 ObservableCollection: Avoid SimpleMonitor allocation
Instead of always allocating an instance of the private `SimpleMonitor`
class for every instance of `ObservableCollection<T>`, lazily allocate
it only if/when a subclass calls `BlockReentrancy`.

Add tests that pass on the full framework and before/after these
changes.

Made some other minor improvements while making changes here, e.g.
removed the unnecessary base ctor call, raise events in the standard
thread-safe way, and remove/sort namespace imports.


Commit migrated from https://github.com/dotnet/corefx/commit/9e7cc5c99ef0e3ce26053e405872bfca7755a223
2016-10-21 07:38:54 -07:00
Justin Van Patten 69d17d5b30 ObservableCollection: Ensure passed-in collection is copied
Ensure the passed-in collection/list is copied to a new List<T>.


Commit migrated from https://github.com/dotnet/corefx/commit/94463e79f79960e41a38202664f16f604004c72d
2016-10-14 09:00:51 -07:00
Jose Perez Rodriguez db4fdbe4d1 Add missing members on System.Collections namespace
Commit migrated from https://github.com/dotnet/corefx/commit/fb0ed20aa2903b8ef43465ff854b93f2639d43f5
2016-10-12 09:12:22 -07:00
Jon Hanna 9e5785eb93 Fix Multiple Typos
Commit migrated from https://github.com/dotnet/corefx/commit/b0dd6b14fc845058b768fc7052b46aab0c1da22c
2016-03-20 16:37:09 +00:00
dotnet-bot b32ddb5d98 Deploy nameof throughout corefx in MemberData
Commit migrated from https://github.com/dotnet/corefx/commit/9c3156b9ada06b8e58ac53d48fc303500bf3e476
2016-02-18 23:58:15 -05:00
dotnet-bot 39d1eab950 Update licensing headers
Commit migrated from https://github.com/dotnet/corefx/commit/7cad8486cbabbce0236bdf530e30db7036335524
2016-01-27 08:02:28 -08:00
Justin Van Patten 9de9241b07 Optimize ObservableCollection<T>'s constructor
Instead of enumerating through the IEnumerable<T> directly, make use
of the List<T> constructor that takes an IEnumerable<T>, which has
optimizations for collections that implement ICollection<T>.

Also, cleaned up the ObservableCollection constructor/property tests.


Commit migrated from https://github.com/dotnet/corefx/commit/6992ca092454231f8152d4f771d2d6d7416de44d
2015-11-27 20:36:26 -08:00
Stephen A. Imhoff 106a87b81d Conform test namespaces in System.ObjectModel to standard in dotnet/corefx#2898
- Some namespaces changed.
- `using`s cleaned up in updated files.


Commit migrated from https://github.com/dotnet/corefx/commit/38938090b961898d119c61a2ac6fb1e051e0a294
2015-09-25 21:44:52 +09:00
Stephen A. Imhoff 7c088fcd28 Remove most instances ofcustom error checking from tests.
Patterns mostly were of the form:

```
if (someBooleanCondition)
{
    Assert.True(false, ....);
    // Or sometimes Assert.False(true, ....);
}
```
or
```
try
{
    SomeErrorThrowingOperation
    Assert.True(false, ....);
    // Or sometimes Assert.False(true, ....);
}
catch (ExpectedExceptionType e)
{
}
```
This replaces most instances with calls to the proper Xunit.Assert#### .
Some additional minor work was performed as noted with the affected package.

Add common ShouldNotBeInvokedException
System.Collections
 - Partially unwind edges of internal test framework.
System.Collections.Concurrent
 - Switch some tests to use InlineData instead of delegated method calls.
System.Collections.Immutable
 - Use ShouldNotBeInvokedException to state some lambdas should not be called.
System.Collections.NonGeneric
System.Composition
 - Partially unwind internal test famework.
 - Switch to using xunit asserts where possible.
System.Diagnostics.Contracts
 - Use ShouldNotBeInvokedException to state some lambdas should not be called.
 - Update project file to use upper case letter in hash.
System.Diagnostics.FileVersionInfo
 - Switch to direct equals comparison.
System.Diagnostics.Process
 - Use ShouldNotBeInvokedException to state a task should exit.
System.Diagnostics.Tracing.Telemetry
 - Use ShouldNotBeInvokedException to state an overridden method should not be called.
System.Globalization
 - Switch to direct equals comparisons in some cases.
System.Globalization.Extensions
 - Switch to direct equals comparison in some cases.
System.IO.Compression.ZipFile
System.IO.FileSystem
 - Partially unwind internal test framework.
System.IO.Packaging
 - Correct test T006 to check that adding absolute Uri part in internal mode is invalid.
System.ObjectModel
 - Use ShouldNotBeInvokedException to state some observables should execute.
System.Reflection
 - Update readonly-set test to verify that the field is set (previous test implied it was not).
System.Reflection.Extensions
System.Reflection.Metadata
 - Partially remove internal test framework.
 - Switch to xunit asserts where possible.
System.Reflection.TypeExtensions
System.Runtime
System.Runtime.Extensions
 - Switch to xunit bounded equals for doubles.
 - Switch to verifying non-varags Path.Combine override.
System.Runtime.Numerics
 - Switch to xunit Assert.Throws from internal version.
System.ServiceProcess.ServiceController
System.Text.Encoding
System.Text.Encodings.Web
System.Threading
System.Threading.Tasks.Dataflow
System.Threading.Tasks.Parallel
System.Xml.ReaderWriter
 - Switch to form verifying exception is thrown.
System.Xml.XmlDocument
 - Use ShouldNotBeInvokedException to state some handlers should not be called.


Commit migrated from https://github.com/dotnet/corefx/commit/ab1743b45213e88295a38e2bf9d80ded09058b18
2015-09-24 20:17:38 +09:00
Stephen Toub e4fe1e6b55 Add tests for System.Collections.* debugger attributes
Our collection types are some of the biggest users of DebuggerDisplayAttribute and DebuggerTypeProxyAttribute.  In the past as we've done refactorings, we've broken these on multiple occasions, and such breaks are often only discovered later on by someone using the types in the IDE.

This change adds some basic tests to exercise these debugger attributes, verifying their existence, that fields/properties they refer to exist, that properties on type proxies don't throw exceptions, etc.  We already had some debugger attribute tests in the System.Threading.Tasks.Dataflow library's tests; I've extracted those into some common helpers which I then use in the various test projects.

These helpers could be used in more test projects in the future.  They could also be expanded to cover more scenarios, as desired.


Commit migrated from https://github.com/dotnet/corefx/commit/f98612e1278908ad3998c90f982e8d1b4c44c320
2015-03-16 16:40:07 -04:00
dotnet-bot 52128f570e Add System.ObjectModel source and tests
Commit migrated from https://github.com/dotnet/corefx/commit/734dfcf6d3c31acb5c8103c904fb0554d4942f2f
2015-02-18 16:19:06 -08:00