Beispiel #1
0
        public void VerifyInergyLocation()
        {
            Random random = new Random();

            IInergyLocation inergyLocation = BusinessObjectInitializer.CreateInergyLocation();

            inergyLocation.Name      = DATestUtils.GenerateString(30, true, false);
            inergyLocation.Code      = DATestUtils.GenerateString(3, true, true);
            inergyLocation.IdCountry = random.Next(1, 3);
            inergyLocation.Rank      = random.Next(100000, 200000);

            int newId = InsertInergyLocationTest(inergyLocation);

            Assert.Greater(newId, 0);

            int rowsAffected = UpdateInergyLocationTest(inergyLocation);

            Assert.AreEqual(1, rowsAffected);

            DataTable resultTable = SelectInergyLocationTest(inergyLocation).Tables[0];

            //Verifies that the table contains the correct column names and order
            StringCollection columns = new StringCollection();

            columns.AddRange(new string[] { "Code",
                                            "Name",
                                            "CountryName",
                                            "Rank",
                                            "CurrencyName",
                                            "Id",
                                            "IdCountry",
                                            "IdCurrency" });
            DATestUtils.CheckTableStructure(resultTable, columns);

            int rowCount = DeleteInergyLocationTest(inergyLocation);

            Assert.AreEqual(1, rowCount);
        }