Exemplo n.º 1
0
        public List <TransportsInfo> GetTransportsInfoList(List <Transports> transports)
        {
            List <TransportsInfo> transportsInfoList = new List <TransportsInfo>();

            foreach (Transports t in transports)
            {
                TransportsInfo info = GetTransportInfo(t);
                transportsInfoList.Add(info);
            }

            return(transportsInfoList);
        }
        public void GetTransportInfo_PassTransportObject_GetCorrectTransportInfoObject()
        {
            //Arrange
            Transports        transport              = TransportListStub.GetTransport();
            TransportsService transportsService      = GetTransportService();
            TransportsInfo    expectedTransportsInfo = GetExpectedTransportsInfo();

            //Act
            TransportsInfo transportInfo = transportsService.GetTransportInfo(transport);

            //Assert
            Assert.AreEqual(expectedTransportsInfo, transportInfo);
        }
Exemplo n.º 3
0
        public TransportsInfo GetTransportInfo(int orderNo)
        {
            TransportsInfo transportInfo = new TransportsInfo();

            var transport = context.Transports.Where(x => x.Id == orderNo).FirstOrDefault();

            if (transport != null)
            {
                transportInfo = GetTransportInfo(transport);
            }

            return(transportInfo);
        }
Exemplo n.º 4
0
        public TransportsInfo GetTransportInfo(Transports transport)
        {
            TransportsInfo transportInfo = new TransportsInfo()
            {
                OrderNo          = transport.Id,
                Address          = transport.Address,
                CustomerName     = transport.CustomerName,
                DateFrom         = transport.DateFrom,
                DateTo           = transport.DateTo,
                Imei             = transport.Tracker.Imei,
                ProjectNo        = transport.ProjectNo,
                TrackerName      = transport.Tracker.Name,
                VehicleType      = transport.VehicleType,
                AddressLatitude  = transport.AddressLatitude,
                AddressLongitude = transport.AddressLongitude,
            };

            return(transportInfo);
        }
        private TransportsInfo GetExpectedTransportsInfo()
        {
            Trackers       tracker = TrackersListStub.GetTracker();
            TransportsInfo expectedTransportsInfo = new TransportsInfo()
            {
                ProjectNo        = "1812",
                Address          = "Address",
                AddressLatitude  = "1",
                AddressLongitude = "2",
                OrderNo          = 1,
                CustomerName     = "Customer",
                DateFrom         = new DateTime(2018, 12, 10, 12, 10, 0),
                DateTo           = new DateTime(2018, 12, 15, 12, 10, 0),
                VehicleType      = "vehicle",
                Imei             = tracker.Imei,
                TrackerName      = tracker.Name
            };

            return(expectedTransportsInfo);
        }