public void ProductDeliveryEquals_NotFound(DeliveryTypeEnum deliveryType) { var item = new OrderItem() { DeliveryType = DeliveryTypeEnum.Physical }; Assert.False(QueryHelpers.ProductDeliveryEquals(item, deliveryType)); }
/// <summary> /// 依照宅配類型新建策略。 /// </summary> /// <param name="deliveryType">宅配類型。</param> /// <returns></returns> /// <exception cref="ArgumentException">請檢查 deliveryType 參數。 - deliveryType</exception> public static IFeeCalculationStrategy CreateStrategy(DeliveryTypeEnum deliveryType) { if (_registry.TryGetValue(deliveryType, out var strategy) == false) { throw new ArgumentException($"請檢查 {nameof(deliveryType)} 參數。", nameof(deliveryType)); } return(strategy); }
public void ProductDeliveryEquals_Found(DeliveryTypeEnum deliveryType) { var item = new OrderItem() { DeliveryType = deliveryType }; Assert.True(QueryHelpers.ProductDeliveryEquals(item, deliveryType)); }
private DisclosureRequest PopulateDisclosureRequest( EllieMae.EMLite.LoanServices.BamObjects.PdfDocument disclosure, DeliveryTypeEnum packageDeliveryTypeEnum) { return(new DisclosureRequest() { DeliveryType = MapDisclosureDeliveryType(disclosure, packageDeliveryTypeEnum), DisclosureName = disclosure.Title }); }
private DocumentDeliveryTypeEnum MapDocDeliveryType(string signatureType, DeliveryTypeEnum packageDeliveryType) { if (packageDeliveryType == DeliveryTypeEnum.Review) { return(DocumentDeliveryTypeEnum.ViewImmediately); } else { return(MapEMDeliveryType(signatureType)); } }
private DisclosureDeliveryTypeEnum MapDisclosureDeliveryType(EllieMae.EMLite.LoanServices.BamObjects.PdfDocument disclosure, DeliveryTypeEnum packageDeliveryTypeEnum) { if (packageDeliveryTypeEnum == DeliveryTypeEnum.Review) { return(DisclosureDeliveryTypeEnum.Review); } else { return(MapEmSigningType(disclosure.SignatureType)); } }
private PostDocumentRequest PopulatePostDocumentRequest( EllieMae.EMLite.LoanServices.BamObjects.PdfDocument disclosure, DeliveryTypeEnum packageDeliveryType) { var loan = EncompassApplication.CurrentLoan; var result = new PostDocumentRequest() { PortalId = loan.Fields["CX.BLEND.LOANID"].ToString(), BorrowerPartyId = BlendUtility.GetCurrentBorrowerPairBorrowerBlendId(loan), CoBorrowerPartyId = BlendUtility.GetCurrentBorrowerPairCoBorrowerBlendId(loan), LosLoanNumber = loan.LoanNumber, FileName = disclosure.Title, DisplayNameAndLosType = disclosure.Title, DocumentDeliveryType = MapDocDeliveryType(disclosure.SignatureType, packageDeliveryType) }; return(result); }
/// <summary> /// Initializes a new instance of the <see cref="EquityOption" /> class. /// </summary> /// <param name="startDate">The start date of the instrument. This is normally synonymous with the trade-date. (required).</param> /// <param name="optionMaturityDate">The maturity date of the option. (required).</param> /// <param name="optionSettlementDate">The settlement date of the option. (required).</param> /// <param name="deliveryType">The available values are: Cash, Physical (required).</param> /// <param name="optionType">The available values are: None, Call, Put (required).</param> /// <param name="strike">The strike of the option. (required).</param> /// <param name="domCcy">The domestic currency of the instrument. (required).</param> /// <param name="underlyingIdentifier">The available values are: LusidInstrumentId, Isin, Sedol, Cusip, ClientInternal, Figi, RIC, QuotePermId, REDCode, BBGId, ICECode (required).</param> /// <param name="code">The reset code of the option. (required).</param> public EquityOption(DateTimeOffset?startDate = default(DateTimeOffset?), DateTimeOffset?optionMaturityDate = default(DateTimeOffset?), DateTimeOffset?optionSettlementDate = default(DateTimeOffset?), DeliveryTypeEnum deliveryType = default(DeliveryTypeEnum), OptionTypeEnum optionType = default(OptionTypeEnum), decimal?strike = default(decimal?), string domCcy = default(string), UnderlyingIdentifierEnum underlyingIdentifier = default(UnderlyingIdentifierEnum), string code = default(string), InstrumentTypeEnum instrumentType = default(InstrumentTypeEnum)) : base(instrumentType) { // to ensure "startDate" is required (not null) if (startDate == null) { throw new InvalidDataException("startDate is a required property for EquityOption and cannot be null"); } else { this.StartDate = startDate; } // to ensure "optionMaturityDate" is required (not null) if (optionMaturityDate == null) { throw new InvalidDataException("optionMaturityDate is a required property for EquityOption and cannot be null"); } else { this.OptionMaturityDate = optionMaturityDate; } // to ensure "optionSettlementDate" is required (not null) if (optionSettlementDate == null) { throw new InvalidDataException("optionSettlementDate is a required property for EquityOption and cannot be null"); } else { this.OptionSettlementDate = optionSettlementDate; } // to ensure "deliveryType" is required (not null) if (deliveryType == null) { throw new InvalidDataException("deliveryType is a required property for EquityOption and cannot be null"); } else { this.DeliveryType = deliveryType; } // to ensure "optionType" is required (not null) if (optionType == null) { throw new InvalidDataException("optionType is a required property for EquityOption and cannot be null"); } else { this.OptionType = optionType; } // to ensure "strike" is required (not null) if (strike == null) { throw new InvalidDataException("strike is a required property for EquityOption and cannot be null"); } else { this.Strike = strike; } // to ensure "domCcy" is required (not null) if (domCcy == null) { throw new InvalidDataException("domCcy is a required property for EquityOption and cannot be null"); } else { this.DomCcy = domCcy; } // to ensure "underlyingIdentifier" is required (not null) if (underlyingIdentifier == null) { throw new InvalidDataException("underlyingIdentifier is a required property for EquityOption and cannot be null"); } else { this.UnderlyingIdentifier = underlyingIdentifier; } // to ensure "code" is required (not null) if (code == null) { throw new InvalidDataException("code is a required property for EquityOption and cannot be null"); } else { this.Code = code; } }
public GasDelivery(XmlNode xmlNode) { XmlNodeList deliveryPointNodeList = xmlNode.SelectNodes("deliveryPoint"); if (deliveryPointNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in deliveryPointNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { deliveryPointIDRef = item.Attributes["id"].Name; GasDeliveryPoint ob = GasDeliveryPoint(); IDManager.SetID(deliveryPointIDRef, ob); } else if (item.Attributes.ToString() == "href") { deliveryPointIDRef = item.Attributes["href"].Name; } else { deliveryPoint = new GasDeliveryPoint(item); } } } XmlNodeList entryPointNodeList = xmlNode.SelectNodes("entryPoint"); if (entryPointNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in entryPointNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { entryPointIDRef = item.Attributes["id"].Name; CommodityDeliveryPoint ob = CommodityDeliveryPoint(); IDManager.SetID(entryPointIDRef, ob); } else if (item.Attributes.ToString() == "href") { entryPointIDRef = item.Attributes["href"].Name; } else { entryPoint = new CommodityDeliveryPoint(item); } } } XmlNodeList withdrawalPointNodeList = xmlNode.SelectNodes("withdrawalPoint"); if (withdrawalPointNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in withdrawalPointNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { withdrawalPointIDRef = item.Attributes["id"].Name; CommodityDeliveryPoint ob = CommodityDeliveryPoint(); IDManager.SetID(withdrawalPointIDRef, ob); } else if (item.Attributes.ToString() == "href") { withdrawalPointIDRef = item.Attributes["href"].Name; } else { withdrawalPoint = new CommodityDeliveryPoint(item); } } } XmlNodeList deliveryTypeNodeList = xmlNode.SelectNodes("deliveryType"); if (deliveryTypeNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in deliveryTypeNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { deliveryTypeIDRef = item.Attributes["id"].Name; DeliveryTypeEnum ob = DeliveryTypeEnum(); IDManager.SetID(deliveryTypeIDRef, ob); } else if (item.Attributes.ToString() == "href") { deliveryTypeIDRef = item.Attributes["href"].Name; } else { deliveryType = new DeliveryTypeEnum(item); } } } XmlNodeList buyerHubNodeList = xmlNode.SelectNodes("buyerHub"); if (buyerHubNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in buyerHubNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { buyerHubIDRef = item.Attributes["id"].Name; CommodityHub ob = CommodityHub(); IDManager.SetID(buyerHubIDRef, ob); } else if (item.Attributes.ToString() == "href") { buyerHubIDRef = item.Attributes["href"].Name; } else { buyerHub = new CommodityHub(item); } } } XmlNodeList sellerHubNodeList = xmlNode.SelectNodes("sellerHub"); if (sellerHubNodeList.Count > 1 ) { throw new Exception(); } foreach (XmlNode item in sellerHubNodeList) { if (item.Attributes["href"] != null || item.Attributes["id"] == null) { if (item.Attributes["id"] != null) { sellerHubIDRef = item.Attributes["id"].Name; CommodityHub ob = CommodityHub(); IDManager.SetID(sellerHubIDRef, ob); } else if (item.Attributes.ToString() == "href") { sellerHubIDRef = item.Attributes["href"].Name; } else { sellerHub = new CommodityHub(item); } } } }