Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }