private ClassCategory GetClassCategory(string className) { //Get value from lookup string lookupValue = String.Empty; foreach (string s in CategoryKeywordsLookup) { if (className.ToLower().Contains(s)) { lookupValue = s; } } if (String.IsNullOrEmpty(lookupValue)) { lookupValue = "default"; } using (PrivateClassesDBContext dbContext = new PrivateClassesDBContext()) { ClassInfoRepo repo = new ClassInfoRepo(dbContext); var res = repo.GetClassCategoryByKeyword(lookupValue); return(res); } }
public void ClassInfoIntegationTests_GetClassCategoryByKeyword() { using (PrivateClassesDBContext dbContext = new PrivateClassesDBContext()) { ClassInfoRepo repo = new ClassInfoRepo(dbContext); var res = repo.GetClassCategoryByKeyword("Party"); Assert.IsTrue(res != null); } }