CSharp/tests/CustomerValidatorTest.cs

21 lines
490 B
C#
Raw Normal View History

2024-03-08 18:16:01 +08:00
namespace Example.Tests;
public class CustomerValidatorTest
{
[Fact]
public void EmptyCustomerObject_is_cannot_be_validated()
{
// given
var customer = new Customer();
var validator = new CustomerValidator();
// when
var result = validator.Validate(customer);
// then
result.IsValid.ShouldBeFalse();
result.Errors.ShouldNotBeEmpty();
result.Errors.Count.ShouldBe(3);
}
}