Skip to content

Commit 9a77edc

Browse files
committed
Add test
1 parent 67924e5 commit 9a77edc

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using Microsoft.AspNetCore.Builder;
5+
using Microsoft.AspNetCore.Http.Metadata;
6+
7+
namespace Microsoft.AspNetCore.Http.Extensions.Tests;
8+
9+
public partial class HttpMetricsEndpointConventionBuilderExtensionsTests
10+
{
11+
[Fact]
12+
public void DisableHttpMetrics_AddsMetadata()
13+
{
14+
var builder = new TestEndointConventionBuilder();
15+
builder.DisableHttpMetrics();
16+
17+
Assert.IsAssignableFrom<IDisableHttpMetricsMetadata>(Assert.Single(builder.Metadata));
18+
}
19+
20+
private sealed class TestEndointConventionBuilder : EndpointBuilder, IEndpointConventionBuilder
21+
{
22+
public void Add(Action<EndpointBuilder> convention)
23+
{
24+
convention(this);
25+
}
26+
27+
public override Endpoint Build() => throw new NotImplementedException();
28+
}
29+
}

0 commit comments

Comments
 (0)