public void ExecuteCommandTest() { SqlConnection connection = new SqlConnection(@"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=EmployeesDB;Integrated Security=True"); connection.Open(); SqlCommand command = new SqlCommand("SELECT * FROM Employees", connection); SqlDataAdapter adapter = new SqlDataAdapter(command); DataSet dataSet = new DataSet(); adapter.Fill(dataSet); connection.Close(); RepositoryBaseInheritorTest repo = new RepositoryBaseInheritorTest("TestDatabase", @"C:\Users\phil3216\source\repos\DataAccess\DataAccessTest\repoBaseTest.xml"); DataSet set = repo.executeTest(new SqlCommand("SELECT * FROM Employees")); string test = set.Tables[0].Rows[0].ItemArray.Aggregate((x, y) => x.ToString() + y.ToString()).ToString(); Assert.AreEqual(test, dataSet.Tables[0].Rows[0].ItemArray.Aggregate((x, y) => x.ToString() + y.ToString()).ToString()); }
public void ConstructorRepository() { RepositoryBaseInheritorTest repo = new RepositoryBaseInheritorTest("TestDatabase", @"C:\Users\phil3216\source\repos\DataAccess\DataAccessTest\repoBaseTest.xml"); Assert.IsTrue(true); }