21 lines
490 B
C#
21 lines
490 B
C#
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);
|
|
|
|
}
|
|
} |