Пример #1
0
        public static void CompareFiles_ReturnsExpectedResults()
        {
            var result = Comparer.CompareFiles(
                "TestFiles\\Microservice-Healthwise-DevBranch-CI-2.json",
                "TestFiles\\Microservice-Healthwise-DevBranch-CI-1.json"
                );

            Assert.That(result, Is.Not.Null);
        }
Пример #2
0
        public void SelectCustomersFromLondon_ShouldPass()
        {
            const string origFile = _path + "CustomersExpected.csv";
            const string outFile  = _path + "CustomersActual.csv";

            const string query =
                "select CustomerID, CompanyName, ContactName, ContactTitle, City, Region, PostalCode, Country " +
                "from Customers where City != 'London' order by ContactTitle";

            SQLServerProvider.ExecuteReaderQuery(query, _connectionString, outFile,
                                                 "CustomerID", "CompanyName", "ContactName", "ContactTitle", "City", "Region", "PostalCode", "Country");

            Assert.True(Comparer.CompareFiles(origFile, outFile));
        }
Пример #3
0
        public void SelectSuppliersWithIdLessThan25_ShouldFail()
        {
            const string origFile = _path + "SuppliersExpected.csv";
            const string outFile  = _path + "SuppliersActual.csv";

            const string query =
                "select SupplierID, ContactName, ContactTitle, City, Address, PostalCode, Country, Phone " +
                "from Suppliers where SupplierID < 25 " +
                "group by ContactTitle, SupplierID, CompanyName, ContactName, City, PostalCode, Country, Phone, Address";

            SQLServerProvider.ExecuteReaderQuery(query, _connectionString, outFile,
                                                 "SupplierID", "ContactName", "ContactTitle", "City", "Address", "PostalCode", "Country", "Phone");

            Assert.True(Comparer.CompareFiles(origFile, outFile));
        }
Пример #4
0
        public void InsertDataToSuppliers_ShouldPass()
        {
            const string origFile = _path + "SuppliersInsert.csv";
            const string outFile  = _path + "SuppliersActual.csv";

            const string query =
                "insert into Suppliers (CompanyName, ContactName, ContactTitle, City, Address, PostalCode, Country, Phone) " +
                "values ('Heli Süßwaren GmbH & Co. KG', 'Sarah Rafferty', 'CTO', 'Berlin', 'Kaloadagatan 13', 'M14 SD', 'Germany', '(010) 9984510')";

            const string selectStatement = "select SupplierID, ContactName, ContactTitle, City, PostalCode, Country, Phone from Suppliers";

            SQLServerProvider.ExecuteManipulativeQuery(query, _connectionString);
            SQLServerProvider.ExecuteReaderQuery(selectStatement, _connectionString, outFile, "SupplierID", "ContactName", "ContactTitle", "City", "PostalCode", "Country", "Phone");

            Assert.False(Comparer.CompareFiles(origFile, outFile));
        }