Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNK committed Jul 9, 2024
1 parent 67924e5 commit 9a77edc
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http.Metadata;

namespace Microsoft.AspNetCore.Http.Extensions.Tests;

public partial class HttpMetricsEndpointConventionBuilderExtensionsTests
{
[Fact]
public void DisableHttpMetrics_AddsMetadata()
{
var builder = new TestEndointConventionBuilder();
builder.DisableHttpMetrics();

Assert.IsAssignableFrom<IDisableHttpMetricsMetadata>(Assert.Single(builder.Metadata));
}

private sealed class TestEndointConventionBuilder : EndpointBuilder, IEndpointConventionBuilder
{
public void Add(Action<EndpointBuilder> convention)
{
convention(this);
}

public override Endpoint Build() => throw new NotImplementedException();
}
}

0 comments on commit 9a77edc

Please sign in to comment.