fix: replace deprecated TestContext with BunitContext
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
@inherits Bunit.TestContext
|
||||
@inherits Bunit.BunitContext
|
||||
|
||||
@code
|
||||
{
|
||||
@@ -11,7 +11,7 @@
|
||||
.Setup(x => x.GetPostsAsync())
|
||||
.ReturnsAsync(new List<Post>());
|
||||
|
||||
var ctx = new TestContext();
|
||||
var ctx = new BunitContext();
|
||||
|
||||
ctx.Services.AddSingleton(_postServiceMock.Object);
|
||||
|
||||
@@ -25,14 +25,14 @@
|
||||
{
|
||||
List<Post> posts = [
|
||||
new Post() { Title = "Post 1", },
|
||||
new Post() { Title = "Post 2", },
|
||||
];
|
||||
new Post() { Title = "Post 2", },
|
||||
];
|
||||
|
||||
_postServiceMock
|
||||
.Setup(x => x.GetPostsAsync())
|
||||
.ReturnsAsync(posts);
|
||||
|
||||
var ctx = new TestContext();
|
||||
var ctx = new BunitContext();
|
||||
|
||||
ctx.Services.AddScoped(_ => _postServiceMock.Object);
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
@inherits Bunit.TestContext
|
||||
@inherits Bunit.BunitContext
|
||||
|
||||
@code
|
||||
{
|
||||
[Test]
|
||||
public void Footer_WhenRendered_ItShouldRenderFooterWithNavLinks()
|
||||
{
|
||||
var ctx = new TestContext();
|
||||
var ctx = new BunitContext();
|
||||
|
||||
var cut = ctx.Render(@<Footer />);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@inherits Bunit.TestContext
|
||||
@inherits Bunit.BunitContext
|
||||
|
||||
@code
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user