Example #1
0
 public static void AssertWebsiteEntry(WebsiteEntry websiteEntry, string hostname, GovernmentType governmentType, string agency, string organization, string city, string state, string contactEmail)
 {
     Assert.AreEqual(hostname, websiteEntry.Hostname);
     Assert.AreEqual(governmentType, websiteEntry.GovernmentType);
     Assert.AreEqual(agency, websiteEntry.Agency);
     Assert.AreEqual(organization, websiteEntry.Organization);
     Assert.AreEqual(city, websiteEntry.City);
     Assert.AreEqual(state, websiteEntry.State);
     Assert.AreEqual(contactEmail, websiteEntry.ContactEmail);
 }
Example #2
0
        public WebsiteCategoryDto GetOrCreateWebsiteCategory(WebsiteEntry websiteEntry)
        {
            var websiteCategory = WebsiteCategoryRepository.GetWebsiteCategory(websiteEntry.GovernmentType, websiteEntry.Agency, websiteEntry.Organization, websiteEntry.City, websiteEntry.State);
            if (websiteCategory == null)
            {
                websiteCategory = new WebsiteCategoryDto()
                {
                    Id = GetNextId(),
                    GovernmentType = (int)websiteEntry.GovernmentType,
                    Agency = websiteEntry.Agency,
                    Organization = websiteEntry.Organization,
                    State = websiteEntry.State,
                    City = websiteEntry.City
                };
                WebsiteCategoryRepository.Add(websiteCategory);
            }

            return websiteCategory;
        }