public void DeleteDeliveryReportById_Success_Test() { // Arrange int id = 1; // create mock for repository var mock = new Mock <IDeliveryReportRepository>(); mock.Setup(s => s.DeleteDeliveryReport(Moq.It.IsAny <int>())).Verifiable(); // service DeliveryReportService deliveryReportService = new DeliveryReportService(); DeliveryReportService.Repository = mock.Object; // Act deliveryReportService.DeleteDeliveryReport(id); // Assert Assert.IsTrue(true); }
public void DeleteDeliveryReport_Success_Test() { // Arrange DeliveryReportDTO dto = SampleDeliveryReportDTO(1); dto.IsDeleted = false; // create mock for repository var mock = new Mock <IDeliveryReportRepository>(); mock.Setup(s => s.DeleteDeliveryReport(Moq.It.IsAny <R_DeliveryReport>())).Verifiable(); // service DeliveryReportService deliveryReportService = new DeliveryReportService(); DeliveryReportService.Repository = mock.Object; // Act deliveryReportService.DeleteDeliveryReport(dto); // Assert Assert.IsTrue(true); }