Skip to content

Commit 6285682

Browse files
rvdginstegavinschultz
authored andcommitted
Test for castleproject#646: asp.net core 6 app causes null reference in scope
1 parent 5a99e06 commit 6285682

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Copyright 2004-2023 Castle Project - http://www.castleproject.org/
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
namespace Castle.Windsor.Extensions.DependencyInjection.Tests
16+
{
17+
using System.Net;
18+
using System.Net.Http;
19+
using System.Threading.Tasks;
20+
21+
using Castle.Windsor.Extensions.DependencyInjection.Tests.AspNetCoreApp;
22+
23+
using Microsoft.AspNetCore.Mvc.Testing;
24+
25+
using Xunit;
26+
27+
public class AspNetCoreScopeTests
28+
{
29+
[Fact]
30+
public async Task TestScopeIsAvailable()
31+
{
32+
WebApplicationFactory<Program> factory = new WebApplicationFactory<Program>();
33+
HttpClient client = factory.CreateClient();
34+
HttpResponseMessage response = await client.GetAsync("/");
35+
Assert.NotNull(response);
36+
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
37+
}
38+
}
39+
}

0 commit comments

Comments
 (0)