Пример #1
0
        public void Setup()
        {
            List <TransportOrder> transportOrder = new List <TransportOrder>();

            {
                new TransportOrder()
                {
                    TransportOrderID         = 1,
                    TransportOrderNo         = "123",
                    ContractNumber           = "123",
                    OrderDate                = new DateTime(12 / 12 / 2012),
                    RequestedDispatchDate    = new DateTime(11 / 11 / 2012),
                    OrderExpiryDate          = new DateTime(10 / 10 / 2012),
                    BidDocumentNo            = "em/200/2006",
                    PerformanceBondReceiptNo = "123456",
                    TransporterID            = 2,
                    ConsignerName            = "name",
                    TransporterSignedName    = "Signed name",
                    ConsignerDate            = new DateTime(02 / 02 / 2013),
                    TransporterSignedDate    = new DateTime(03 / 03 / 2012),
                };
            }
            ;

            Mock <ITransportOrderService> mockTransportOrderService = new Mock <ITransportOrderService>();

            mockTransportOrderService.Setup(m => m.GetAllTransportOrder()).Returns(transportOrder);
            this.MockTransportOrderService = mockTransportOrderService.Object;
            _dispatchLocationsController   = new DispatchLocationsController(MockTransportOrderService);
        }
Пример #2
0
 public void Dispatch_Locations_Controller_Constructor_Test()
 {
     try
     {
         _dispatchLocationsController = new DispatchLocationsController(MockTransportOrderService);
     }
     catch (Exception e)
     {
         Assert.Fail(e.Message);
     }
 }
        public void Dispatch_Locations_Controller_Constructor_Test()
        {
            try
            {
                _dispatchLocationsController = new DispatchLocationsController(MockTransportOrderService);

            }
            catch (Exception e)
            {

                Assert.Fail(e.Message);
            }
        }
        public void Setup()
        {
            List<TransportOrder> transportOrder = new List<TransportOrder>();
            {
                new TransportOrder()
                {
                    TransportOrderID = 1,
                    TransportOrderNo = "123",
                    ContractNumber = "123",
                    OrderDate = new DateTime(12 / 12 / 2012),
                    RequestedDispatchDate = new DateTime(11 / 11 / 2012),
                    OrderExpiryDate = new DateTime(10 / 10 / 2012),
                    BidDocumentNo = "em/200/2006",
                    PerformanceBondReceiptNo = "123456",
                    TransporterID = 2,
                    ConsignerName = "name",
                    TransporterSignedName = "Signed name",
                    ConsignerDate = new DateTime(02 / 02 / 2013),
                    TransporterSignedDate = new DateTime(03 / 03 / 2012),
                };

            }
            ;

            Mock<ITransportOrderService> mockTransportOrderService=new Mock<ITransportOrderService>();

            mockTransportOrderService.Setup(m => m.GetAllTransportOrder()).Returns(transportOrder);
            this.MockTransportOrderService = mockTransportOrderService.Object;
            _dispatchLocationsController=new DispatchLocationsController(MockTransportOrderService);
        }