public void Validate_WhenPrescriptionsEmpty_ReturnsExpectedFailure(CreatePharmaceuticalPrescriptions command) { // Arrange var validator = CreateValidator(); // Act var results = validator.Validate(command); // Assert results.Errors.Should().ContainSingle(f => f.ErrorCode == "PrescriptionsEmpty" && f.Severity == Severity.Error); }
private static CreatePharmaceuticalPrescriptions CommandWithPrescriptionCount(int prescriptionCount) { var command = new CreatePharmaceuticalPrescriptions(); for (var i = 0; i < prescriptionCount; i++) { command.Prescriptions.Add(new PharmaceuticalPrescriptionDescriptor()); } return(command); }
public void Validate_WhenHealthFacilityIdentifierInvalid_ReturnsExpectedFailure(int healthFacilityIdentifier) { // Arrange var validator = CreateValidator(); var command = new CreatePharmaceuticalPrescriptions { HealthFacilityIdentifier = healthFacilityIdentifier }; // Act var results = validator.Validate(command); // Assert results.Errors.Should().ContainSingle(f => f.ErrorCode == "HealthFacilityIdentifierInvalid" && f.Severity == Severity.Error); }
public void Validate_WhenPrescriberLicenseNumberInvalid_ReturnsExpectedFailure(string prescriberLicenseNumber) { // Arrange var validator = CreateValidator(); var command = new CreatePharmaceuticalPrescriptions { PrescriberLicenseNumber = prescriberLicenseNumber }; // Act var results = validator.Validate(command); // Assert results.Errors.Should().Contain(f => f.ErrorCode == "PrescriberLicenseNumberInvalid" && f.Severity == Severity.Error); }
public void Validate_WhenPrescriberSocialSecurityNumberValid_ReturnsNoSpecificFailure(string prescriberSocialSecurityNumber) { // Arrange var validator = CreateValidator(); var command = new CreatePharmaceuticalPrescriptions { PrescriberSocialSecurityNumber = prescriberSocialSecurityNumber }; // Act var results = validator.Validate(command); // Assert results.Errors.Should().NotContain(f => f.ErrorCode == "PrescriberSocialSecurityNumberInvalid"); }
public void Validate_WhenPrescriberLastNameNotEmpty_ReturnsNoSpecificFailure(string prescriberLastName) { // Arrange var validator = CreateValidator(); var command = new CreatePharmaceuticalPrescriptions { PrescriberLastName = prescriberLastName }; // Act var results = validator.Validate(command); // Assert results.Errors.Should().NotContain(f => f.ErrorCode == "PrescriberLastNameEmpty"); }
public void Validate_WhenPatientLastNameEmpty_ReturnsExpectedFailure(string patientLastName) { // Arrange var validator = CreateValidator(); var command = new CreatePharmaceuticalPrescriptions { PatientLastName = patientLastName }; // Act var results = validator.Validate(command); // Assert results.Errors.Should().ContainSingle(f => f.ErrorCode == "PatientLastNameEmpty" && f.Severity == Severity.Error); }
public void Validate_WhenPatientIdentifierValid_ReturnsNoSpecificFailure(int patientIdentifier) { // Arrange var validator = CreateValidator(); var command = new CreatePharmaceuticalPrescriptions { PatientIdentifier = patientIdentifier }; // Act var results = validator.Validate(command); // Assert results.Errors.Should().NotContain(f => f.ErrorCode == "PatientIdentifierInvalid"); }
public void Validate_WhenLanguageCodeValid_ReturnsNoSpecificFailure(string languageCode) { // Arrange var validator = CreateValidator(); var command = new CreatePharmaceuticalPrescriptions { LanguageCode = languageCode }; // Act var results = validator.Validate(command); // Assert results.Errors.Should().NotContain(f => f.ErrorCode == "LanguageCodeInvalid"); }
public void Validate_WhenHealthFacilityLicenseNumberValid_ReturnsNoSpecificFailure(string healthFacilityLicenseNumber) { // Arrange var validator = CreateValidator(); var command = new CreatePharmaceuticalPrescriptions { HealthFacilityLicenseNumber = healthFacilityLicenseNumber }; // Act var results = validator.Validate(command); // Assert results.Errors.Should().NotContain(f => f.ErrorCode == "HealthFacilityLicenseNumberInvalid"); }