Add multiple prescriptions parsing.
This commit is contained in:
@ -44,5 +44,31 @@ namespace Tests.Medication
|
||||
Assert.AreEqual(noon, p.Noon, "Noon should be " + noon);
|
||||
Assert.AreEqual(evening, p.Evening, "Evening should be " + evening);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MultiplePrescriptions()
|
||||
{
|
||||
IEnumerable<Prescription> list = Prescription.ManyFromLine(
|
||||
"Ramipril 5 mg 1-0-0 Prograf 1 mg 1-0-1");
|
||||
Assert.AreEqual(2, list.Count());
|
||||
Assert.AreEqual("Ramipril 5 mg\t1-0-0", list.First().ToString());
|
||||
Assert.AreEqual("Prograf 1 mg\t1-0-1", list.Last().ToString());
|
||||
}
|
||||
|
||||
[Test]
|
||||
[TestCase("Ramipril 5 mg", "1", "0", "0", "0", "Ramipril 5 mg\t1-0-0-0")]
|
||||
[TestCase("Ramipril 5 mg", "1", "0", "0", "", "Ramipril 5 mg\t1-0-0")]
|
||||
[TestCase("Ramipril 5 mg", "1", "0", "", "", "Ramipril 5 mg\t1-0")]
|
||||
[TestCase("Ramipril 5 mg", "1", "", "", "", "Ramipril 5 mg\t1")]
|
||||
[TestCase("Ramipril 5 mg", "1", "", "0", "0", "Ramipril 5 mg\t1-0-0-0")]
|
||||
[TestCase("Ramipril 5 mg", "1", "0", "", "0", "Ramipril 5 mg\t1-0-0-0")]
|
||||
[TestCase("Ramipril 5 mg", "1", "", "", "0", "Ramipril 5 mg\t1-0-0-0")]
|
||||
[TestCase("Ramipril 5 mg", "", "", "", "", "Ramipril 5 mg\t")]
|
||||
public void PrescriptionToString(string drug, string morning, string noon,
|
||||
string evening, string night, string formatted)
|
||||
{
|
||||
Prescription p = new Prescription(drug, morning, noon, evening, night);
|
||||
Assert.AreEqual(formatted, p.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user