xamarin-macios/tests/cecil-tests
Sebastien Pouliot e343e68725
[tests][cecil] Check that error-based enum values don't have availability attributes (#9737)
and fixes the ones that have some.

From https://github.com/xamarin/xamarin-macios/issues/9724

We do not _normally_ add availability attributes on enums **members** that represent error codes. In part because it's a lot of metadata and, foremost, because it's not really helpful to write code. E.g.

```csharp
var err = Call.Api (1);
switch (err) {
case NSError.Bad:
case NSError.Wrong:
   Console.WriteLine ($"API failed: {err});
   break;
case NSError.Ok:
   break;
default:
   Console.WriteLine ($"Unknown error code {err}");
   break;
}
```

Adding version checks inside this would be complicated (source wise) and not really helpful since
* API can return undefined error code (and the error logic should work);
* Availability information is not 100% accurate;

As such we default to not add them - but we some time forgot about it.
2020-09-30 15:15:18 -04:00
..
EnumTest.cs [tests][cecil] Check that error-based enum values don't have availability attributes (#9737) 2020-09-30 15:15:18 -04:00
Helper.cs [msbuild] Make sure all the Base/Core tasks are abstract. (#8888) 2020-06-19 17:40:18 +02:00
Makefile [tests] Port cecil-tests to new-style csproj. (#8663) 2020-05-25 14:47:20 +02:00
README.md [tests] Add cecil-based unit tests (#7825) 2020-02-10 17:23:12 -05:00
TaskAssemblyTests.cs [Xcode12] Bring xcode 12 changes into main. 2020-09-23 16:05:22 -04:00
Test.cs [tests][cecil] Check for absence of `[NoX]` (Unavailable) in platform assemblies. Fix #4835 (#9686) 2020-09-30 07:56:48 -04:00
cecil-tests.csproj [tests][cecil] Check for absence of `[NoX]` (Unavailable) in platform assemblies. Fix #4835 (#9686) 2020-09-30 07:56:48 -04:00

README.md

Cecil-based Tests

Even with the huge variety of tests that we have there's still a few things that are hard to test properly. Some of them can be tested by analyzing the assemblies (IL or metadata). So here we are...