public void Project_Fetch()
        {
            var project = ProjectTestHelper.ProjectNew();

            project = ProjectRepository.ProjectSave(project);

            project = ProjectRepository.ProjectFetch(project.ProjectId);

            Assert.IsTrue(project != null, "Row returned should not equal null");
        }
        public void Project_Add()
        {
            var project = ProjectTestHelper.ProjectNew();

            Assert.IsTrue(project.IsValid, "IsValid should be true");

            project = ProjectRepository.ProjectSave(project);

            Assert.IsTrue(project.ProjectId != 0, "ProjectId should be a non-zero value");

            ProjectRepository.ProjectFetch(project.ProjectId);
        }
        public void Project_Edit()
        {
            var project = ProjectTestHelper.ProjectNew();

            var name = project.Name;

            Assert.IsTrue(project.IsValid, "IsValid should be true");

            project = ProjectRepository.ProjectSave(project);

            project = ProjectRepository.ProjectFetch(project.ProjectId);

            project.Name = DataHelper.RandomString(20);

            project = ProjectRepository.ProjectSave(project);

            project = ProjectRepository.ProjectFetch(project.ProjectId);

            Assert.IsTrue(project.Name != name, "Name should have different value");
        }
        public void Project_Delete()
        {
            var project = ProjectTestHelper.ProjectNew();

            Assert.IsTrue(project.IsValid, "IsValid should be true");

            project = ProjectRepository.ProjectSave(project);

            project = ProjectRepository.ProjectFetch(project.ProjectId);

            ProjectRepository.ProjectDelete(project.ProjectId);

            try
            {
                ProjectRepository.ProjectFetch(project.ProjectId);
            }
            catch (Exception ex)
            {
                Assert.IsTrue(ex.GetBaseException() is InvalidOperationException);
            }
        }