diff --git a/tests/Tests/ApiTests.cs b/tests/Tests/ApiTests.cs index 9b6f4dcf7f..114aac3cee 100644 --- a/tests/Tests/ApiTests.cs +++ b/tests/Tests/ApiTests.cs @@ -56,6 +56,8 @@ public class ApiTest : BaseTest public static IEnumerable InteropDelegatesData => InteropDelegates.Select(m => new object[] { m }); + // Targets using USE_LIBRARY_IMPORT don't have delegates generated as they are not used. +#if !USE_LIBRARY_IMPORT [Trait(Traits.Category.Key, Traits.Category.Values.Api)] [SkippableFact] public void DelegateTypesAreValid() @@ -71,6 +73,7 @@ public void DelegateTypesHaveAttributes(Type delegateType) { Assert.NotNull(delegateType.GetCustomAttribute()); } +#endif [Trait(Traits.Category.Key, Traits.Category.Values.Api)] [SkippableTheory]