示例#1
0
 public void CannotBeGeneratedWithNull()
 {
     Assert.Throws <ArgumentNullException>(() =>
     {
         var origination = Origination.Of(null);
     });
 }
示例#2
0
        public Case(CaseStateHistory history, Origination origination, Account account, KeyFactsIllustration kfi)
        {
            if (origination != null)
            {
                CustomerId              = origination.CustomerNumber;
                KfiId                   = origination.KfiId;
                ApplicationNumber       = origination.ApplicationNumber;
                CreatedDate             = PhoebusMinDateToNull(origination.DateKfiCreated);
                DeclinedDate            = origination.PrimaryStatusChar == OriginationStatus.Rejected ? PhoebusMinDateToNull(origination.StatusChangeDate) : null;
                OfferDate               = PhoebusMinDateToNull(origination.OfferDate);
                SubmittedDate           = PhoebusMinDateToNull(origination.DateApplicationReceived);
                WithdrawnDate           = origination.PrimaryStatusChar == OriginationStatus.Withdrawn ? PhoebusMinDateToNull(origination.StatusChangeDate) : null;
                OfferNumber             = origination.OfferNumber;
                PrimaryStatus           = origination.PrimaryStatus;
                DateApplicationReceived = origination.DateApplicationReceived;
            }

            if (origination != null && account != null)
            {
                CompletionDate = origination.PrimaryStatusChar == OriginationStatus.Complete ? PhoebusMinDateToNull(account.CompletionDate) : null;
            }

            if (kfi != null)
            {
                CustomerSurname    = kfi.Customer1Surname;
                KfiId              = kfi.KfiId;
                ExpiredDate        = PhoebusMinDateToNull(kfi.ExpiryDate);
                KfiDate            = PhoebusMinDateToNull(kfi.KfiDate);
                PackagerMortgageId = kfi.PackagerMortgageId;
                KfiType            = kfi.KfiType;
                Division           = kfi.Division;

                if (origination == null && account == null)
                {
                    ClientOne = new Person {
                        DateOfBirth = kfi.Customer1DateOfBirth
                    };
                    ClientTwo = new Person {
                        DateOfBirth = kfi.Customer2DateOfBirth
                    };

                    ClientOneContact = new Contact {
                        Title = kfi.Customer1Title, Forename = kfi.Customer1Forename, Surname = kfi.Customer1Surname
                    };
                    ClientTwoContact = new Contact {
                        Title = kfi.Customer2Title, Forename = kfi.Customer2Forename, Surname = kfi.Customer2Surname
                    };

                    KfiOnly = true;
                }
            }

            if (history != null)
            {
                KfiId     = history.KfiId;
                StateId   = history.CaseStateId;
                CaseState = history.CaseState;
            }
        }
示例#3
0
        public void ShouldExecuteActionWhenHasOriginated()
        {
            var expected    = false;
            var origination = Origination.Of(() =>
            {
                expected = true;
            });

            origination.Originate();

            Assert.IsTrue(expected);
        }
示例#4
0
        public Case(CaseStateHistory history,
                    Origination origination,
                    Account account,
                    KeyFactsIllustration kfi,
                    PropertyVisit visit,
                    AddressSelection address) : this(history, origination, account, kfi)
        {
            ValuationDate = visit?.DateOfSurvey;

            PoR = BuildPoRLabel(address);

            FullAddress = BuildAddressLabel(address);

            PostCode = address?.PostCode;
        }
 public PartnerTrip(Partner partner, string ID, Origination origination, Location pickupLocation, DateTime pickupTime, PaymentMethod? paymentMethod = null, string passengerID = null, string passengerName = null, Location dropoffLocation = null,
    DateTime? dropoffTime = null, List<Location> waypoints = null, VehicleType? vehicleType = null, double? maxPrice = null, int? minRating = null, PartnerFleet fleet = null, Driver driver = null, TimeSpan? duration = null, TimeSpan? driverRouteDuration = null, double? price = null)
 {
     this.ID = ID;
     this.origination = origination;
     this.service = Origination.Local;
     this.partner = partner;
     this.passengerID = passengerID;
     this.passengerName = passengerName;
     this.pickupLocation = pickupLocation;
     this.pickupTime = pickupTime;
     this.duration = duration;
     this.dropoffLocation = dropoffLocation;
     this.dropoffTime = dropoffTime;
     this.waypoints = waypoints;
     this.paymentMethod = paymentMethod;
     this.vehicleType = vehicleType;
     this.maxPrice = maxPrice;
     this.minRating = minRating;
     this.PartnerFleet = fleet;
     this.driver = driver;
     this.price = price;
     this.UpdateTripStatus(notifyPartner: false, status: Status.New);
 }
 public PartnerTrip(PartnerTrip t)
 {
     this.ID = t.ID;
     this.passengerID = t.passengerID;
     this.passengerName = t.passengerName;
     this.origination = t.origination;
     this.service = t.service;
     this.luggage = t.luggage;
     this.persons = t.persons;
     this.pickupLocation = t.pickupLocation;
     this.pickupTime = t.pickupTime;
     this.duration = t.duration;
     this.dropoffLocation = t.dropoffLocation;
     this.dropoffTime = t.dropoffTime;
     this.waypoints = t.waypoints;
     this.paymentMethod = t.paymentMethod;
     this.vehicleType = t.vehicleType;
     this.price = t.price;
     this.maxPrice = t.maxPrice;
     this.minRating = t.minRating;
     this.PartnerFleet = t.PartnerFleet;
     this.driver = t.driver;
     this.lastUpdate = t.lastUpdate;
     this._status = t._status;
     this.partner = t.partner;
     this.lastDispatchAttempt = DateTime.MinValue;
 }