public void TestSecFormFactory() { var testResult = SecForm.SecFormFactory("10-K"); Assert.IsNotNull(testResult); Assert.IsInstanceOf(typeof(Form10K), testResult); }
internal static Tuple <SecForm, string> ParseNameFromTitle(string titleText) { var blank = new Tuple <SecForm, string>(new Form10K(), String.Empty); if (String.IsNullOrWhiteSpace(titleText)) { return(blank); } if (!titleText.Contains("-")) { return(blank); } string name; if (!RegexCatalog.IsRegexMatch(titleText, @"(.*)?\x20\x2D\x20(.*)?", out name, 2)) { return(blank); } string formAbbrev; RegexCatalog.IsRegexMatch(titleText, @"(.*)?\x20\x2D\x20(.*)?", out formAbbrev, 1); var secForm = SecForm.SecFormFactory(formAbbrev) ?? new Form10K(); return(new Tuple <SecForm, string>(secForm, (name ?? String.Empty).Trim())); }