public async Task NullUser_Throws() { var validator = new UserCreatedRequiredValidator <User>(); await Assert.ThrowsAsync <ArgumentNullException>("user", async() => { await validator.Validate(user: null !); });
public async Task WhenCalled_Succeeds() { var validator = new UserCreatedRequiredValidator <User>(); var user = new User() { Created = DateTimeOffset.UtcNow }; await validator.Validate(user); }
public async Task DefaultCreated_Throws() { var validator = new UserCreatedRequiredValidator <User>(); var user = new User() { Created = default(DateTimeOffset) }; await Assert.ThrowsAsync <ArgumentException>("user", async() => { await validator.Validate(user); }); }