-
Notifications
You must be signed in to change notification settings - Fork 29
/
Interface_event_attributes.cs
57 lines (53 loc) · 1.57 KB
/
Interface_event_attributes.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using PublicApiGenerator;
using PublicApiGeneratorTests.Examples;
using Xunit;
namespace PublicApiGeneratorTests
{
public class Interface_event_attributes : ApiGeneratorTestsBase
{
[Fact]
public void Should_add_attribute_to_event()
{
AssertPublicApi<IInterfaceWithEventWithAttribute>(
@"namespace PublicApiGeneratorTests.Examples
{
public interface IInterfaceWithEventWithAttribute
{
[PublicApiGeneratorTests.Examples.Simple]
public event System.EventHandler OnClicked;
}
}");
}
[Fact]
public void Should_skip_excluded_attribute()
{
var options = new DefaultApiGeneratorOptions
{
ExcludeAttributes = new[] { "PublicApiGeneratorTests.Examples.SimpleAttribute" }
};
AssertPublicApi<IInterfaceWithEventWithAttribute>(
@"namespace PublicApiGeneratorTests.Examples
{
public interface IInterfaceWithEventWithAttribute
{
public event System.EventHandler OnClicked;
}
}", options);
}
}
// ReSharper disable EventNeverSubscribedTo.Global
// ReSharper disable EventNeverInvoked
// ReSharper disable ClassNeverInstantiated.Global
namespace Examples
{
public interface IInterfaceWithEventWithAttribute
{
[SimpleAttribute]
event EventHandler OnClicked;
}
}
// ReSharper restore ClassNeverInstantiated.Global
// ReSharper restore EventNeverInvoked
// ReSharper restore EventNeverSubscribedTo.Global
}