コード例 #1
0
        public int RemoveOldMedicament(ChoosenMedicamentModel medicament)
        {
            int previousAmount = medicament.Amount;

            TotalCost -= medicament.TotalPrice;
            ListOfChoosenMedicament.Remove(medicament);
            return(previousAmount);
        }
コード例 #2
0
        public void ChoosenMedicamentModelTest()
        {
            // Arrange
            string name   = "Paracetamol 500mg";
            double price  = 15.99;
            int    amount = 4;

            // Act
            ChoosenMedicamentModel Drug = new ChoosenMedicamentModel(name, amount, price);

            // Assert
            Assert.AreEqual(Drug.Name, name, "Błąd we własciwości Name");
            Assert.AreEqual(Drug.Amount, amount, "Błąd we własciwości Amount");
            Assert.AreEqual(Drug.TotalPrice, price * amount, "Bład we właściwości TotalPrice");
        }