Beispiel #1
0
        public void ExistingWithResourceThenDeferredDeleteParent()
        {
            // Get a Project that exists in the database (with children)
            Project project = ProjectFactory.ExistingProjectWithResource();

            // Save the ID for use later
            Guid projectId = project.Id;

            // Mark the project for "deferred" deletion
            project.Delete();

            // Now call the Save(), which will actually delete the object
            project = project.Save();
            Assert.IsNotNull(project);

            // Check the instance returned by the Save()...
            // ... has no (child) resources ...
            Assert.AreEqual(0, project.Resources.Count);

            // ... is marked as "new" ...
            Assert.IsTrue(project.IsNew);

            // Check the database to see if the Project exists there
            bool exists = ProjectFactory.ProjectExists(projectId);

            Assert.IsFalse(exists);
        }
Beispiel #2
0
        public void ExistingWithResource()
        {
            // Get an existing Resource with an Assignment
            Project existingProject = ProjectFactory.ExistingProjectWithResource();

            // Delete the project
            Guid projectId = existingProject.Id;

            Project.DeleteProject(projectId);

            // Check if the Project exists now
            bool exists = ProjectFactory.ProjectExists(projectId);

            Assert.IsFalse(exists);
        }
Beispiel #3
0
        public void Existing()
        {
            // Create an existing object
            Project existingProject = ProjectFactory.ExistingProject();

            // Delete the project
            Guid projectId = existingProject.Id;

            Project.DeleteProject(projectId);

            // Check if the Project exists now
            bool exists = ProjectFactory.ProjectExists(projectId);

            Assert.IsFalse(exists);
        }