예제 #1
0
        public void DeleteSupplierTypeById_Success_Test()
        {
            // Arrange
            int id = 1;

            // create mock for repository
            var mock = new Mock <ISupplierTypeRepository>();

            mock.Setup(s => s.DeleteSupplierType(Moq.It.IsAny <int>())).Verifiable();

            // service
            SupplierTypeService supplierTypeService = new SupplierTypeService();

            SupplierTypeService.Repository = mock.Object;

            // Act
            supplierTypeService.DeleteSupplierType(id);

            // Assert
            Assert.IsTrue(true);
        }
예제 #2
0
        public void DeleteSupplierType_Success_Test()
        {
            // Arrange
            SupplierTypeDTO dto = SampleSupplierTypeDTO(1);

            dto.IsDeleted = false;

            // create mock for repository
            var mock = new Mock <ISupplierTypeRepository>();

            mock.Setup(s => s.DeleteSupplierType(Moq.It.IsAny <R_SupplierType>())).Verifiable();

            // service
            SupplierTypeService supplierTypeService = new SupplierTypeService();

            SupplierTypeService.Repository = mock.Object;

            // Act
            supplierTypeService.DeleteSupplierType(dto);

            // Assert
            Assert.IsTrue(true);
        }