Skip to content

Commit

Permalink
feat: Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Nov 26, 2023
1 parent 458ff76 commit 5a6697e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/bunit.generators/Web.Stubs/StubGenerator.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using Microsoft.CodeAnalysis;
Expand Down
10 changes: 10 additions & 0 deletions tests/bunit.generators.tests/Web.Stub/StubTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,14 @@ public void Stubbed_component_has_same_parameters()
var child = cut.FindComponent<CounterComponentStub>();
Assert.Equal(2, child.Instance.Count);
}

[Fact]
public void Stubbed_component_can_be_used_in_multiple_tests()
{
ComponentFactories.AddGeneratedStub<CounterComponent>();

var cut = RenderComponent<ParentComponent>();

Assert.True(cut.HasComponent<CounterComponentStub>());
}
}

0 comments on commit 5a6697e

Please sign in to comment.