Ejemplo n.º 1
0
        public void VerifyProjectPhase()
        {
            Random random = new Random();

            IProjectPhase projectPhase = BusinessObjectInitializer.CreateProjectPhase();

            projectPhase.Name = DATestUtils.GenerateString(50, true, false);
            projectPhase.Code = DATestUtils.GenerateString(10, true, true);

            int newId = InsertProjectPhaseTest(projectPhase);

            Assert.Greater(newId, 0);

            int rowsAffected = UpdateProjectPhaseTest(projectPhase);

            Assert.AreEqual(1, rowsAffected);

            DataTable resultTable = SelectProjectPhaseTest(projectPhase).Tables[0];

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

            columns.AddRange(new string[] { "Id",
                                            "Code",
                                            "Name" });

            DATestUtils.CheckTableStructure(resultTable, columns);


            int rowCount = DeleteProjectPhaseTest(projectPhase);

            Assert.AreEqual(1, rowCount);
        }