/// <summary> /// Set the type id of the webhook. /// </summary> /// <param name="type">The type of webhook.</param> /// <returns>The instance of the webhook.</returns> public IWebhook SetTypeId(WebHookType type) { this.type = type; this.id = EnumLookup.GetWebhookTypeName(type); return(this); }
private CorrectableReportingEntity_Type GetReportingEntity(ExcelPackage package) { var repEnt = new CorrectableReportingEntity_Type(); repEnt.Entity = GetOrganisationPartyType(EnumLookup.GetCountryCodeEnumType(GetExcelStringValue(package, "CoverPage", "B6")), // CountryCode_Type.ZA, // (S: CoverPage; Cells: B7) EnumLookup.GetCountryCodeEnumType(GetExcelStringValue(package, "CoverPage", "B7")), // CountryCode_Type.ZA, // (S: CoverPage; Cells: B8) GetExcelStringValue(package, "CoverPage", "B8"), //"9000051715", // (S: CoverPage; Cells: B9) EnumLookup.GetCountryCodeEnumType(GetExcelStringValue(package, "CoverPage", "B9")), // CountryCode_Type.ZA, // (S: CoverPage; Cells: B10) GetExcelStringValue(package, "CoverPage", "B10"), //"1918/000095/06", // (S: CoverPage; Cells: B11) GetExcelStringValue(package, "CoverPage", "B11"), //"Barloworld Limited", // (S: CoverPage; Cells: B12) EnumLookup.GetCountryCodeEnumType(GetExcelStringValue(package, "CoverPage", "B12")), // CountryCode_Type.ZA, // (S: CoverPage; Cells: B13) GetExcelStringValue(package, "CoverPage", "B13").Split(';'), // new object[] { "61 Katherine Street", "Sandton", "2196" }, // (S: CoverPage; Cells: B14) "61 Katherine Street;Sandton;2196" (Split on ;) EnumLookup.GetOECDLegalAddressTypeEnumType(GetExcelStringValue(package, "CoverPage", "B14"))); //OECDLegalAddressType_EnumType.OECD304);// (S: CoverPage; Cells: B15) repEnt.ReportingRole = EnumLookup.GetCbcReportingRoleEnumType(GetExcelStringValue(package, "CoverPage", "B16")); // CbcReportingRole_EnumType.CBC701; // (S: CoverPage; Cells: B17) var docTypeIndic = GetExcelStringValue(package, "CoverPage", "B17"); var docRefId = GetExcelStringValue(package, "CoverPage", "B18"); var corrDocRefId = GetExcelStringValue(package, "CoverPage", "B19"); var corrMessageRefId = GetExcelStringValue(package, "CoverPage", "B3"); repEnt.DocSpec = GetDocSpec(package, docTypeIndic, docRefId, corrDocRefId, corrMessageRefId); return(repEnt); }
public void CanParseEnums() { EnumLookup.Register(typeof(SkillLevel2), "pro=Advanced,guru=Advanced,master=Advanced"); SkillLevel2 skill = (SkillLevel2)EnumLookup.GetValue(typeof(SkillLevel2), "guru"); Assert.AreEqual(skill, SkillLevel2.Advanced); }
public void Check_DomainClickTrackingActive_Yes_Should_Return_String_yes() { var type = DomainClickTrackingActive.YES; var name = EnumLookup.GetDomainClickTrackingActiveName(type); Assert.Equal("yes", name); }
public void Check_Access_Level_Read_Only_Should_Return_String_readonly() { AccessLevel type = AccessLevel.READ_ONLY; var name = EnumLookup.GetAccessLevelName(type); Assert.Equal("readonly", name); }
public void Check_Access_Level_Everyone_Should_Return_String_everyone() { AccessLevel type = AccessLevel.EVERYONE; var name = EnumLookup.GetAccessLevelName(type); Assert.Equal("everyone", name); }
public void Check_Access_Level_Members_Should_Return_String_members() { AccessLevel type = AccessLevel.MEMBERS; var name = EnumLookup.GetAccessLevelName(type); Assert.Equal("members", name); }
public void Check_Webhook_Type_Name_TemporaryFail_Should_Return_String_temporary_fail() { var type = WebHookType.TEMPORARY_FAIL; var name = EnumLookup.GetWebhookTypeName(type); Assert.Equal("temporary_fail", name); }
public void Check_Webhook_Type_Name_PermanentFailed_Should_Return_String_permanent_failed() { var type = WebHookType.PERMANENT_FAIL; var name = EnumLookup.GetWebhookTypeName(type); Assert.Equal("permanent_fail", name); }
public void Check_Severity_Type_Permanent_Should_Return_string_permanent() { var type = Severity.PERMANENT; var name = EnumLookup.GetSeverityTypeName(type); Assert.Equal("permanent", name); }
public void Check_Severity_Type_Temporary_Should_Return_string_temporary() { var type = Severity.TEMPORARY; var name = EnumLookup.GetSeverityTypeName(type); Assert.Equal("temporary", name); }
public void Check_SpamAction_Blocked_Should_Return_String_blocked() { var type = SpamAction.BLOCKED; var name = EnumLookup.GetSpamActionName(type); Assert.Equal("blocked", name); }
public void Check_SpamAction_Tag_Should_Return_String_tag() { var type = SpamAction.TAG; var name = EnumLookup.GetSpamActionName(type); Assert.Equal("tag", name); }
public void Check_SpamAction_Disabled_Should_Return_String_disabled() { var type = SpamAction.DISABLED; var name = EnumLookup.GetSpamActionName(type); Assert.Equal("disabled", name); }
public void Check_DomainClickTrackingActive_HtmlOnly_Should_Return_String_htmlonly() { var type = DomainClickTrackingActive.HTML_ONLY; var name = EnumLookup.GetDomainClickTrackingActiveName(type); Assert.Equal("htmlonly", name); }
public void Check_Event_Type_Name_Accepted_Should_Return_String_accepted() { var type = EventType.ACCEPTED; var name = EnumLookup.GetEventTypeName(type); Assert.Equal("accepted", name); }
public void Check_DomainClickTrackingActive_No_Should_Return_String_no() { var type = DomainClickTrackingActive.NO; var name = EnumLookup.GetDomainClickTrackingActiveName(type); Assert.Equal("no", name); }
public void Check_Event_Type_Name_Unsubscribed_Should_Return_String_unsubscribed() { var type = EventType.UNSUBSCRIBED; var name = EnumLookup.GetEventTypeName(type); Assert.Equal("unsubscribed", name); }
public void Check_Event_Type_Name_Opened_Should_Return_String_opened() { var type = EventType.OPENED; var name = EnumLookup.GetEventTypeName(type); Assert.Equal("opened", name); }
public void Check_Event_Type_Name_Stored_Should_Return_String_stored() { var type = EventType.STORED; var name = EnumLookup.GetEventTypeName(type); Assert.Equal("stored", name); }
public void Check_Event_Type_Name_Delivered_Should_Return_String_delivered() { var type = EventType.DELIVERED; var name = EnumLookup.GetEventTypeName(type); Assert.Equal("delivered", name); }
public void Check_Event_Type_Name_Failed_Should_Return_String_failed() { var type = EventType.FAILED; var name = EnumLookup.GetEventTypeName(type); Assert.Equal("failed", name); }
public void Check_Event_Type_Name_Clicked_Should_Return_String_clicked() { var type = EventType.CLICKED; var name = EnumLookup.GetEventTypeName(type); Assert.Equal("clicked", name); }
public void Check_Event_Type_Name_Complained_Should_Return_String_complained() { var type = EventType.COMPLAINED; var name = EnumLookup.GetEventTypeName(type); Assert.Equal("complained", name); }
public void Check_TimeResolution_Hour_Should_Return_String_h() { var type = TimeResolution.HOUR; var name = EnumLookup.GetTimeResolutionName(type); Assert.Equal("h", name); }
public void Check_TimeResolution_Month_Should_Return_String_m() { var type = TimeResolution.MONTH; var name = EnumLookup.GetTimeResolutionName(type); Assert.Equal("m", name); }
public void Check_TimeResolution_Day_Should_Return_String_d() { var type = TimeResolution.DAY; var name = EnumLookup.GetTimeResolutionName(type); Assert.Equal("d", name); }
public ActionResult GetEmployeeType() { var lookupResult = new EnumLookup().LookupFluentBuilder <EmployeeType>() .SetFlagValueAsValueField() .SetFlagNameAsValueField() .SplitCamelCaseInTextField() .GenerateLookupData() .GetLookup(); return(Json(lookupResult, JsonRequestBehavior.AllowGet)); }
/// <summary> /// Return the mailing list object as a list of key-value pairs. /// </summary> /// <returns>List of key value pairs.</returns> public ICollection <KeyValuePair <string, string> > ToFormContent() { var content = new Collection <KeyValuePair <string, string> >() { new KeyValuePair <string, string>("address", this.emailAddress.ToString()), new KeyValuePair <string, string>("name", this.name), new KeyValuePair <string, string>("description", this.description), new KeyValuePair <string, string>("access_level", EnumLookup.GetAccessLevelName(this.accessLevel)) }; return(content); }
/// <summary> /// Return the mailing list object as json. /// </summary> /// <returns>A Json object.</returns> public JObject ToJson() { var jsonObject = new JObject { ["address"] = this.emailAddress.ToString(), ["name"] = this.name, ["description"] = this.description, ["access_level"] = EnumLookup.GetAccessLevelName(this.accessLevel) }; return(jsonObject); }