public async void EmployeeId_Create_Valid_Reference() { Mock <ICustomerCommunicationRepository> customerCommunicationRepository = new Mock <ICustomerCommunicationRepository>(); customerCommunicationRepository.Setup(x => x.EmployeeByEmployeeId(It.IsAny <int>())).Returns(Task.FromResult <Employee>(new Employee())); var validator = new ApiCustomerCommunicationServerRequestModelValidator(customerCommunicationRepository.Object); await validator.ValidateCreateAsync(new ApiCustomerCommunicationServerRequestModel()); validator.ShouldNotHaveValidationErrorFor(x => x.EmployeeId, 1); }
public async void CustomerId_Update_Valid_Reference() { Mock <ICustomerCommunicationRepository> customerCommunicationRepository = new Mock <ICustomerCommunicationRepository>(); customerCommunicationRepository.Setup(x => x.CustomerByCustomerId(It.IsAny <int>())).Returns(Task.FromResult <Customer>(new Customer())); var validator = new ApiCustomerCommunicationServerRequestModelValidator(customerCommunicationRepository.Object); await validator.ValidateUpdateAsync(default(int), new ApiCustomerCommunicationServerRequestModel()); validator.ShouldNotHaveValidationErrorFor(x => x.CustomerId, 1); }