Skip to content

Commit

Permalink
Rename Invoking tests
Browse files Browse the repository at this point in the history
And align content of tests a bit
  • Loading branch information
eNeRGy164 committed Mar 12, 2022
1 parent 21d2bda commit 1450705
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace FluentAssertions.Specs.Exceptions
public class InvokingActionSpecs
{
[Fact]
public void When_invoking_an_action_on_a_null_subject_it_should_throw()
public void Invoking_on_null_is_not_allowed()
{
// Arrange
Does someClass = null;
Expand All @@ -20,13 +20,13 @@ public void When_invoking_an_action_on_a_null_subject_it_should_throw()
}

[Fact]
public void When_invoking_an_action_with_null_it_should_throw()
public void Invoking_with_null_is_not_allowed()
{
// Arrange
Does someClass = Does.NotThrow();

// Act
Action act = () => someClass.Invoking(null).Should().NotThrow();
Action act = () => someClass.Invoking(null);

// Assert
act.Should().ThrowExactly<ArgumentNullException>()
Expand Down
10 changes: 5 additions & 5 deletions Tests/FluentAssertions.Specs/Exceptions/InvokingFunctionSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ namespace FluentAssertions.Specs.Exceptions
public class InvokingFunctionSpecs
{
[Fact]
public void When_invoking_a_function_on_a_null_subject_it_should_throw()
public void Invoking_on_null_is_not_allowed()
{
// Arrange
Does someClass = null;

// Act
Action act = () => someClass.Invoking(d => d.ToString());
Action act = () => someClass.Invoking(d => d.Return());

// Assert
act.Should().ThrowExactly<ArgumentNullException>()
.WithParameterName("subject");
}

[Fact]
public void When_invoking_a_function_with_null_it_should_throw()
public void Invoking_with_null_is_not_allowed()
{
// Arrange
object someClass = new();
Does someClass = Does.NotThrow();

// Act
Action act = () => someClass.Invoking((Func<object, string>)null);
Action act = () => someClass.Invoking((Func<Does, object>)null);

// Assert
act.Should().ThrowExactly<ArgumentNullException>()
Expand Down

0 comments on commit 1450705

Please sign in to comment.