31 lines
658 B
C#
31 lines
658 B
C#
using AwesomeAssertions;
|
|
using GerstITS.Examples.Logic.Shared.Validation;
|
|
using GerstITS.TestFramework;
|
|
using Xunit;
|
|
|
|
namespace GerstITS.Examples.Tests.Shared.Validation;
|
|
|
|
[TestCategory(TestCategories.Unit)]
|
|
public sealed class IdValidationRuleTest
|
|
{
|
|
#region Tests
|
|
|
|
[Fact]
|
|
public void If_the_id_is_positive___It_is_valid()
|
|
{
|
|
var result = new IdValidationRule().Validate((object)1);
|
|
|
|
result.IsValid.Should().BeTrue();
|
|
}
|
|
|
|
[Fact]
|
|
public void If_the_id_is_zero___It_is_invalid()
|
|
{
|
|
var result = new IdValidationRule().Validate((object)0);
|
|
|
|
result.IsValid.Should().BeFalse();
|
|
}
|
|
|
|
#endregion
|
|
}
|