Skip to content

Commit

Permalink
One more EBN and add test (#39365)
Browse files Browse the repository at this point in the history
* One more EBN and add test

* Fix
  • Loading branch information
JoshLove-msft authored and drielenr committed Oct 24, 2023
1 parent 6180040 commit ed5102c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,7 @@ public partial class AcsRouterJobReceivedEventData : Azure.Messaging.EventGrid.S
{
internal AcsRouterJobReceivedEventData() { }
public string ClassificationPolicyId { get { throw null; } }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public Azure.Messaging.EventGrid.Models.AcsRouterJobStatus? JobStatus { get { throw null; } }
public int? Priority { get { throw null; } }
public System.Collections.Generic.IReadOnlyList<Azure.Messaging.EventGrid.SystemEvents.AcsRouterWorkerSelector> RequestedWorkerSelectors { get { throw null; } }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.ComponentModel;
using Azure.Core;

namespace Azure.Messaging.EventGrid.SystemEvents
Expand All @@ -12,6 +13,7 @@ public partial class AcsRouterJobReceivedEventData
public AcsRouterJobStatus? Status { get; }

/// <summary> Router Job Received Job Status. </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public Azure.Messaging.EventGrid.Models.AcsRouterJobStatus? JobStatus
{
get
Expand Down
14 changes: 14 additions & 0 deletions sdk/eventgrid/Azure.Messaging.EventGrid/tests/SystemEventTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using Azure.Messaging.EventGrid.SystemEvents;
Expand Down Expand Up @@ -77,6 +78,19 @@ public void EventPropertiesCasedCorrectly()
}
}

[Test]
public void ModelsAreInCorrectNamespace()
{
foreach (Type model in Assembly.GetAssembly(typeof(EventGridEvent)).GetTypes())
{
if (model.IsPublic && model.Namespace == "Azure.Messaging.EventGrid.Models"
&& model.GetCustomAttribute<EditorBrowsableAttribute>() == null)
{
Assert.Fail($"{model} is not in the correct namespace. It should be in Azure.Messaging.EventGrid.SystemEvents.");
}
}
}

private void ValidateName(string name)
{
if (s_casingExclusions.Contains(name))
Expand Down

0 comments on commit ed5102c

Please sign in to comment.