Update tests to remove the suppression.
}
}
-#pragma warning disable 618 // Must test deprecated features
-
// The ComAwareEventInfo is used by the compiler when PIAs
// containing COM Events are embedded.
static void Validate_COMEventViaComAwareEventInfo()
}
}
-#pragma warning restore 618 // Must test deprecated features
-
static int Main(string[] doNotUse)
{
// RegFree COM is not supported on Windows Nano
using System.Runtime.InteropServices;
using Server.Contract;
-#pragma warning disable 618 // Must test deprecated features
-
[ComVisible(true)]
[Guid(Server.Contract.Guids.EventTesting)]
[ComSourceInterfaces(typeof(Server.Contract.TestingEvents))]
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#pragma warning disable 618 // Must test deprecated features
-
namespace Server.Contract
{
using System;
}
}
}
-
-#pragma warning restore 618 // Must test deprecated features
public string Value { get { throw null; } }
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [System.ObsoleteAttribute("ComAwareEventInfo may be unavailable in future releases.")]
public partial class ComAwareEventInfo : System.Reflection.EventInfo
{
public ComAwareEventInfo(System.Type type, string eventName) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Interface, Inherited=false)]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [System.ObsoleteAttribute("ComEventInterfaceAttribute may be unavailable in future releases.")]
public sealed partial class ComEventInterfaceAttribute : System.Attribute
{
public ComEventInterfaceAttribute(System.Type SourceInterface, System.Type EventProvider) { }
public System.Type SourceInterface { get { throw null; } }
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [System.ObsoleteAttribute("ComEventsHelper may be unavailable in future releases.")]
public static partial class ComEventsHelper
{
public static void Combine(object rcw, System.Guid iid, int dispid, System.Delegate d) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class, Inherited=true)]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
- [System.ObsoleteAttribute("ComSourceInterfacesAttribute may be unavailable in future releases.")]
public sealed partial class ComSourceInterfacesAttribute : System.Attribute
{
public ComSourceInterfacesAttribute(string sourceInterfaces) { }
namespace System.Runtime.InteropServices.Tests
{
-#pragma warning disable 0618 // CompareEventInfo is marked as Obsolete.
public partial class ComAwareEventInfoTests
{
[ComEventInterface(typeof(DispAttributeClass), typeof(int))]
public void Event() { }
}
}
-#pragma warning restore 0618
}
namespace System.Runtime.InteropServices.Tests
{
-#pragma warning disable 0618 // CompareEventInfo is marked as Obsolete.
public partial class ComAwareEventInfoTests
{
[Fact]
public void Raise(object sender) => Event.Invoke(1, null);
}
}
-#pragma warning restore 0618
}
namespace System.Runtime.InteropServices.Tests
{
-#pragma warning disable 0618 // ComEventInterfaceAttribute is marked as Obsolete.
public class ComEventInterfaceAttributeTests
{
[Theory]
Assert.Equal(eventProvider, attribute.EventProvider);
}
}
-#pragma warning restore 0618
}
namespace System.Runtime.InteropServices.Tests
{
-#pragma warning disable 0618 // ComEventsHelper is marked as Obsolete.
public class ComEventsHelperTests
{
[Fact]
AssertExtensions.Throws<ArgumentException>("obj", () => ComEventsHelper.Remove(1, Guid.Empty, 1, null));
}
}
-#pragma warning restore 0618
}
namespace System.Runtime.InteropServices.Tests
{
-#pragma warning disable 0618 // ComSourceInterfacesAttribute is marked as Obsolete.
public class ComSourceInterfacesAttributeTests
{
[Theory]
Assert.Throws<NullReferenceException>(() => new ComSourceInterfacesAttribute(typeof(int), typeof(string), typeof(bool), null));
}
}
-#pragma warning restore 0618
}