Skip to content

Commit d12aca7

Browse files
committed
Reveal problem in SingleTypeKernelAssertions
Update test assertions to reveal a problem in SingleTypeKernelAssertions.BuildFailureMessage() Two tests will now fail with a System.NullReferenceException
1 parent 35f26a1 commit d12aca7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/FluentAssertions.Ioc.Ninject.Tests/KernelAssertionTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public void Should_succeed_when_asserting_interfaces_can_be_resolved_with_a_sing
2323
Action act = () => kernel.Should().Resolve(interfaces).WithSingleInstance();
2424

2525
// Assert
26-
act.ShouldNotThrow<AssertionException>();
26+
act.ShouldNotThrow();
2727
}
2828

2929
[Test]
@@ -51,7 +51,7 @@ public void Should_succeed_when_asserting_an_interface_can_be_resolved_with_a_si
5151
Action act = () => kernel.Should().Resolve<ISampleService>().WithSingleInstance();
5252

5353
// Assert
54-
act.ShouldNotThrow<AssertionException>();
54+
act.ShouldNotThrow();
5555
}
5656

5757
[Test]
@@ -77,7 +77,7 @@ public void Should_succeed_when_asserting_interface_can_be_resolved_with_at_leas
7777
Action act = () => kernel.Should().Resolve<ISomeProvider>().WithAtLeastOneInstance();
7878

7979
// Assert
80-
act.ShouldNotThrow<AssertionException>();
80+
act.ShouldNotThrow();
8181
}
8282

8383
[Test]
@@ -105,7 +105,7 @@ public void Should_succeed_when_asserting_interfaces_can_be_resolved_with_at_lea
105105
Action act = () => kernel.Should().Resolve(interfaces).WithAtLeastOneInstance();
106106

107107
// Assert
108-
act.ShouldNotThrow<AssertionException>();
108+
act.ShouldNotThrow();
109109
}
110110

111111
[Test]
@@ -134,7 +134,7 @@ public void Should_succeed_when_asserting_interfaces_can_be_resolved_when_implem
134134
Action act = () => kernel.Should().Resolve(interfaces).WithSingleInstance();
135135

136136
// Assert
137-
act.ShouldNotThrow<AssertionException>();
137+
act.ShouldNotThrow();
138138
}
139139

140140
[Test]
@@ -163,7 +163,7 @@ public void Should_succeed_when_asserting_an_interface_resolves_to_concrete_impl
163163
Action act = () => kernel.Should().Resolve<IFooService>().To<FooService>();
164164

165165
// Assert
166-
act.ShouldNotThrow<Exception>();
166+
act.ShouldNotThrow();
167167
}
168168

169169
[Test]

0 commit comments

Comments
 (0)