Skip to content

Commit

Permalink
Remove some Shouldly code
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreuCodina committed Aug 25, 2023
1 parent d26e7a4 commit 737bd19
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using CrossValidation.UnitTests.TestUtils.Fixtures;
using CrossValidation.UnitTests.TestUtils.Models;
using CrossValidation.Validations;
using Shouldly;
using FluentAssertions;
using Xunit;

namespace CrossValidation.UnitTests.Validations.ValidationExtensions;
Expand All @@ -30,7 +30,8 @@ public void Null_works_with_nullable_value_types()
.Null()
.Must(_commonFixture.BeValid);

action.ShouldNotThrow();
action.Should()
.NotThrow();
}

[Fact]
Expand All @@ -40,7 +41,8 @@ public void Null_works_with_nullable_reference_types()
.Null()
.Must(_commonFixture.BeValid);

action.ShouldNotThrow();
action.Should()
.NotThrow();
}

[Fact]
Expand All @@ -53,7 +55,11 @@ public void Throw_exception_when_the_validation_fails()
var action = () => Validate.Field(_model.NullableString)
.Null();

var exception = action.ShouldThrow<CommonException.NullException>();
exception.Code.ShouldBe(nameof(ErrorResource.Null));
action.Should()
.Throw<CommonException.NullException>()
.And
.Code
.Should()
.Be(nameof(ErrorResource.Null));
}
}

0 comments on commit 737bd19

Please sign in to comment.