public List<ClientOrganization> GetClientOrgList() { var queryResult = new List<ClientOrganization>(); using (var connection = GetSqlConnection()) { connection.Open(); using (SqlCommand command = new SqlCommand("dbo.GetListOfHealthSystems", connection)) { using (SqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { int Id = reader.FieldToInt("HealthSystemID"); var Name = reader.FieldToString("Name"); var URL = reader.FieldToString("URL"); var Active = reader.FieldToBool("Active"); var item = new ClientOrganization() { HealthSystemID = Id, Name = Name, URL = URL, Active = Active, }; queryResult.Add(item); } } } } return queryResult; }
static void Main(string[] args) { var dataProvider = new DataProvider(); var ActiveList = dataProvider.GetClientOrgList(); int processed = 0; var clientOrgs = dataProvider.GetClientOrgList(); Program test = new Program(); foreach (var activeFlags in ActiveList) { ++processed; _activeFlag = activeFlags; if (processed == Convert.ToInt16(clientOrgs.Count)) break; if (_activeFlag.Active == true) { try { //Get List of clients TestResultUtility testResultUtility = new TestResultUtility(); foreach (var client in clientOrgs) { _currentClient = client; InitTests(test); ServiceLineExplorertests(test); PatientExplorerTests(test); CommunityExplorerTests(test); GeographicExplorerTests(test); FacilityExplorerTests(test); test.TearDown(); } Console.WriteLine("Failed Test Count: {0}", test.ExceptionList.Count); Environment.Exit(test.ExceptionList.Count); } catch (Exception e) { } } else { } } }