예제 #1
0
        public void GetSupplierType_Success_Test()
        {
            // Arrange
            int            id           = 1;
            R_SupplierType supplierType = SampleSupplierType(id);

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

            mock.Setup(s => s.GetSupplierType(Moq.It.IsAny <int>())).Returns(supplierType);

            // service
            SupplierTypeService supplierTypeService = new SupplierTypeService();

            SupplierTypeService.Repository = mock.Object;

            // Act
            SupplierTypeDTO result = supplierTypeService.GetSupplierType(id);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.SupplierTypeId);
        }
 /// <summary>
 /// 下拉列表框
 /// </summary>
 /// <returns></returns>
 public static IQueryable GetSupplierType()
 {
     return(SupplierTypeService.GetSupplierType());
 }