Beispiel #1
0
        public static BillInfoToPayModel map(Bill bill)
        {
            BillInfoToPayModel billInfoToPayModel = new BillInfoToPayModel();

            billInfoToPayModel.Weight           = bill.Delivery.Weight;
            billInfoToPayModel.Price            = bill.CostInCents;
            billInfoToPayModel.DeliveryId       = bill.Delivery.DeliveryId;
            billInfoToPayModel.BillId           = bill.BillId;
            billInfoToPayModel.AddreeseeEmail   = bill.Delivery.Addressee.Email;
            billInfoToPayModel.LocalitySandName = bill.Delivery.Way.LocalitySand.NameEn;
            billInfoToPayModel.LocalityGetName  = bill.Delivery.Way.LocalityGet.NameEn;
            return(billInfoToPayModel);
        }
Beispiel #2
0
        public void getBillsToPayByUserId()
        {
            BillInfoToPayModel billInfoToPayDto = ServicesTestConstant.getBillInfoToPayDto();
            Bill bill = ServicesTestConstant.getBill();

            billInfoToPayDto.LocalityGetName  = bill.Delivery.Way.LocalityGet.NameEn;
            billInfoToPayDto.LocalitySandName = bill.Delivery.Way.LocalitySand.NameEn;

            List <BillInfoToPayModel> result = _billService.GetBillsToPayByUserName(ServicesTestConstant.getUserId());

            _billRepository.Verify(place => place.FindAllByUserIdAndIsDeliveryPaidFalse
                                       (ServicesTestConstant.getUserId()), Times.Once());
            Assert.AreEqual(ServicesTestConstant.getBills().Count, result.Count);
            Assert.AreEqual(billInfoToPayDto, result[0]);
        }
Beispiel #3
0
        public void getBillsToPayByUserId()
        {
            Delivery           setupDeliveryAndBill       = EntitySetuper.SetupDeliveryAndBill(_context, false, false);
            BillInfoToPayModel expectedBillInfoToPayModel = new BillInfoToPayModel(setupDeliveryAndBill.Bill.BillId,
                                                                                   setupDeliveryAndBill.Bill.CostInCents, setupDeliveryAndBill.DeliveryId, setupDeliveryAndBill.Weight,
                                                                                   setupDeliveryAndBill.Addressee.Email);

            expectedBillInfoToPayModel.LocalityGetName  = setupDeliveryAndBill.Way.LocalityGet.NameEn;
            expectedBillInfoToPayModel.LocalitySandName = setupDeliveryAndBill.Way.LocalitySand.NameEn;

            List <BillInfoToPayModel> result =
                _billService.GetBillsToPayByUserName(setupDeliveryAndBill.Bill.User.UserName);

            Assert.AreEqual(ServicesTestConstant.getBills().Count, result.Count);
            Assert.AreEqual(expectedBillInfoToPayModel, result[0]);
        }
Beispiel #4
0
 protected bool Equals(BillInfoToPayModel other)
 {
     return(BillId == other.BillId && Price == other.Price && DeliveryId == other.DeliveryId && Weight == other.Weight && AddreeseeEmail == other.AddreeseeEmail && LocalitySandName == other.LocalitySandName && LocalityGetName == other.LocalityGetName);
 }