示例#1
0
        public void ServiceOrderItemDto_Extension_AsEntity_Null()
        {
            ServiceOrderItemDto serviceOrderItem = null;
            var result = serviceOrderItem.AsEntity();

            Assert.IsNull(result);
            Assert.AreEqual(null, result);
        }
示例#2
0
        public void ServiceOrderItemDto_Property_Quantity()
        {
            var     serviceOrderItem = new ServiceOrderItemDto();
            decimal value            = 100;

            serviceOrderItem.Quantity = value;

            Assert.IsNotNull(serviceOrderItem.Quantity);
            Assert.IsInstanceOfType(serviceOrderItem.Quantity, typeof(decimal));
            Assert.AreEqual(value, serviceOrderItem.Quantity);
        }
示例#3
0
        public void ServiceOrderItemDto_Property_ServiceId()
        {
            var serviceOrderItem = new ServiceOrderItemDto();
            var value            = 99;

            serviceOrderItem.ServiceId = value;

            Assert.IsNotNull(serviceOrderItem.ServiceId);
            Assert.IsInstanceOfType(serviceOrderItem.ServiceId, typeof(int));
            Assert.AreEqual(value, serviceOrderItem.ServiceId);
        }
        public static ServiceOrderItem AsEntity(this ServiceOrderItemDto serviceOrderItemDto)
        {
            if (serviceOrderItemDto == null)
            {
                return(null);
            }

            return(new ServiceOrderItem
            {
                OrderId = serviceOrderItemDto.OrderId,
                ServiceId = serviceOrderItemDto.ServiceId,
                Quantity = serviceOrderItemDto.Quantity
            });
        }
示例#5
0
        public void ServiceOrderItemDto_Property_Count()
        {
            var serviceOrderItem = new ServiceOrderItemDto();

            Assert.AreEqual(3, serviceOrderItem.GetType().GetProperties().Count());
        }