Граф коммитов

3 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 1b12348e57 [tests] Refactor API to check/assert current OS version. 2018-07-04 12:35:15 +02:00
Rolf Bjarne Kvinge 9703f17c91 [monotouch-test] Fix versions checks.
* Fix many version checks to be based on Xcode version instead of iOS version.
* Added/fixed a few expected values according to platform version to match behavior in older macOS versions.
2018-07-03 20:47:14 +02:00
Rolf Bjarne Kvinge c8bd5e3cff [Foundation] Set 'sentRequest' when sending a request in NSUrlSessionHandler. (#1806)
* [Foundation] Set 'sentRequest' when sending a request in NSUrlSessionHandler.

Fixes this compiler warning:

> [..]/external/mono/mcs/class/System.Net.Http/HttpClientEx.cs(50,8): warning CS0649: Field `Foundation.NSUrlSessionHandler.sentRequest' is never assigned to, and will always have its default value `false'

However it changes the runtime behavior, and we'll now throw an exception in
cases that we accepted before:

* `sentRequest` is only read in `EnsureModifiability ()`, which throws an
  exception if `sentRequest` is true.
* Previously `sentRequest` was never set (thus the compiler warning), which
  meant `EnsureModifiability` would never throw an exception.
* Looking at the similar `CFNetworkHandler` (which has the identical field and
  methods), it seems that the intended behavior is to set `sentRequest` in
  `SendAsync`, and then `EnsureModifiability` is called whenever a property is
  set to ensure the property isn't set too late (and any change would be
  ignored because the request was already sent).
* This means that previously setting any property after the request was sent
  would not throw any exceptions (even though the change would be ignored),
  while with this change we'd start throwing exceptions.

* Add missing tests for the setRequest var.

* Redesign tests to make sure that all handlers run the same code.

* Fix failing test.

* Add the managed handler to the HttpClient tests.

* Fix minor style issues.
2017-06-05 09:21:28 -04:00