We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6052b0b commit 0b5090aCopy full SHA for 0b5090a
src/libraries/System.Net.Primitives/tests/FunctionalTests/IPAddressTest.cs
@@ -369,6 +369,15 @@ public static void Address_ThrowsIPv6SpecificMessage()
369
Assert.Equal((int)SocketError.OperationNotSupported, ex.ErrorCode);
370
Assert.Contains($"'{ip.AddressFamily}' {nameof(AddressFamily)}.", ex.Message);
371
}
372
+
373
+ [Fact]
374
+ public static void Address_ReadOnlyStatic_ThrowsReadOnlyException()
375
+ {
376
+ var readOnlyIp = IPAddress.Loopback;
377
+ var ex = Assert.Throws<SocketException>(() => readOnlyIp.Address = 0x0A000001L);
378
+ Assert.Equal((int)SocketError.OperationNotSupported, ex.ErrorCode);
379
+ Assert.Contains("read-only", ex.Message);
380
+ }
381
#pragma warning restore 618
382
383
0 commit comments