public async Task Write_When_Email_Already_Exists_Should_Not_Write( Employee employee, EmployeeWriterWithEmailAlreadyExistsValidation sut) { sut.EmployeeReader.Any(employee.Email.Address).Returns(true); await sut.Write(employee); sut.NotificationStore.Received().AddNotification(Arg.Is <Notification>(x => x.Message == "Email already registred")); await sut.EmployeeWriter.DidNotReceive().Write(employee); }
public async Task Write_When_Email_Does_Not_Exist_Should_Write( Employee employee, EmployeeWriterWithEmailAlreadyExistsValidation sut) { sut.EmployeeReader.Any(employee.Email.Address).Returns(false); await sut.Write(employee); await sut.EmployeeWriter.Received().Write(employee); sut.NotificationStore.DidNotReceive().AddNotification(Arg.Any <Notification>()); }