public void TestPost() { var result = controller.Post(mockMedicationModel(4)); mockDatabase.VerifyGet(x => x.Cabinets, Times.Once); materializeMedication(result); Assert.IsTrue(result.Id > 3); verifyStandardMedication(result, result.Id); }
public void Post_Creates_New_Medication() { var medication = new Medication(); repo.Create(medication).Returns(true); var result = underTest.Post(medication); Assert.True(result); }
public void ShouldFailIfQuantityIsLessThanOne() { //Arrange MedicationViewModel medicationViewModel = new MedicationViewModel() { CreationDate = DateTime.Now, Quantity = 0 }; MedicationController controller = new MedicationController(_medicationService); var result = controller.Post(medicationViewModel); //Act //Assert }