Skip to content

Commit 6d7285a

Browse files
linkdotnetegil
authored andcommitted
feat: Add more tests
1 parent 14e5c19 commit 6d7285a

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/bunit.generators/Web.Stubs/StubGenerator.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Collections.Immutable;
4-
using System.Diagnostics.CodeAnalysis;
54
using System.Linq;
65
using System.Text;
76
using Microsoft.CodeAnalysis;

tests/bunit.generators.tests/Web.Stub/StubTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,14 @@ public void Stubbed_component_has_same_parameters()
1212
var child = cut.FindComponent<CounterComponentStub>();
1313
Assert.Equal(2, child.Instance.Count);
1414
}
15+
16+
[Fact]
17+
public void Stubbed_component_can_be_used_in_multiple_tests()
18+
{
19+
ComponentFactories.AddGeneratedStub<CounterComponent>();
20+
21+
var cut = RenderComponent<ParentComponent>();
22+
23+
Assert.True(cut.HasComponent<CounterComponentStub>());
24+
}
1525
}

0 commit comments

Comments
 (0)