From 737bd193633b11e8300288bc774a8d82f31ec65b Mon Sep 17 00:00:00 2001 From: Andreu Codina <30506301+AndreuCodina@users.noreply.github.com> Date: Fri, 25 Aug 2023 07:45:12 +0200 Subject: [PATCH] Remove some Shouldly code --- .../ValidationExtensions/NullTests.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/CrossValidation.UnitTests/Validations/ValidationExtensions/NullTests.cs b/tests/CrossValidation.UnitTests/Validations/ValidationExtensions/NullTests.cs index 66c3740..c22a2f2 100644 --- a/tests/CrossValidation.UnitTests/Validations/ValidationExtensions/NullTests.cs +++ b/tests/CrossValidation.UnitTests/Validations/ValidationExtensions/NullTests.cs @@ -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; @@ -30,7 +30,8 @@ public void Null_works_with_nullable_value_types() .Null() .Must(_commonFixture.BeValid); - action.ShouldNotThrow(); + action.Should() + .NotThrow(); } [Fact] @@ -40,7 +41,8 @@ public void Null_works_with_nullable_reference_types() .Null() .Must(_commonFixture.BeValid); - action.ShouldNotThrow(); + action.Should() + .NotThrow(); } [Fact] @@ -53,7 +55,11 @@ public void Throw_exception_when_the_validation_fails() var action = () => Validate.Field(_model.NullableString) .Null(); - var exception = action.ShouldThrow(); - exception.Code.ShouldBe(nameof(ErrorResource.Null)); + action.Should() + .Throw() + .And + .Code + .Should() + .Be(nameof(ErrorResource.Null)); } } \ No newline at end of file