[tests] Adjust the PclTest.ServiceModel test to not throw ArgumentNullException in .NET.

This fix works just as well for the current Mono BCL as well, so there's no .NET condition.

This fixes this link sdk test:

    LinkSdk.PclTest
        [FAIL] ServiceModel : System.ArgumentNullException : Value cannot be null. (Parameter 'name')
            at System.ServiceModel.Channels.AddressHeaderCollection.FindAll(String name, String ns)
            at LinkSdk.PclTest.ServiceModel() in /Users/rolf/work/maccore/whatever/xamarin-macios/tests/linker/ios/link sdk/PclTest.cs:line 73
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
This commit is contained in:
Rolf Bjarne Kvinge 2020-08-26 09:38:23 +02:00
Родитель eb79bccd74
Коммит 1adcd5e89c
1 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -70,20 +70,30 @@ namespace LinkSdk {
{
AddressHeaderCollection ahc = new AddressHeaderCollection ();
try {
ahc.FindAll (null, null);
ahc.FindAll ("name", "namespace");
}
catch (NotImplementedException) {
// feature is not available, but the symbol itself is needed
}
try {
FaultException.CreateFault (null, String.Empty, null);
FaultException.CreateFault (new TestFault (), String.Empty, Array.Empty<Type> ());
}
catch (NotImplementedException) {
// feature is not available, but the symbol itself is needed
}
}
class TestFault : MessageFault {
public override FaultCode Code => throw new NotImplementedException ();
public override bool HasDetail => throw new NotImplementedException ();
public override FaultReason Reason => throw new NotImplementedException ();
protected override void OnWriteDetailContents (XmlDictionaryWriter writer)
{
throw new NotImplementedException ();
}
}
[Test]
public void Xml ()
{