Ejemplo n.º 1
0
        public void ComputeCheckDigit_WhenValidCode_ReturnsExpectedValue(string code, int expectedValue)
        {
            // Act
            var checkDigit = BelgianMedicationCode.ComputeCheckDigit(code);

            // Assert
            checkDigit.Should().Be(expectedValue);
        }
Ejemplo n.º 2
0
        public void MedicationUniqueIdentifier_WhenValidCode_ReturnsExpectedValue(string code, int expectedValue)
        {
            // Arrange
            var medicationCode = new BelgianMedicationCode(code);
            // Act
            var identifier = medicationCode.MedicationUniqueIdentifier();

            // Assert
            identifier.Should().Be(expectedValue);
        }
Ejemplo n.º 3
0
        public void CheckDigit_WhenValidCode_ReturnsExpectedValue(string code, int expectedValue)
        {
            // Arrange
            var medicationCode = new BelgianMedicationCode(code);
            // Act
            var checkDigit = medicationCode.CheckDigit();

            // Assert
            checkDigit.Should().Be(expectedValue);
        }
 private static PrescribedPharmaceuticalSubstance CreateSubstance(PrescribedMedicationState state)
 {
     return(new PrescribedPharmaceuticalSubstance
            (
                state.NameOrDescription,
                state.Posology,
                state.Quantity,
                BelgianMedicationCode.CreateIfNotEmpty(state.Code),
                state.Identifier,
                state.EntityState
            ));
 }