public void TestMoveIsDirty() { // Given a connection to an instance of VersionOne at https://www14.v1host.com/v1sdktesting/ with user credentials for admin var instance = new V1Instance("https://www14.v1host.com/v1sdktesting/", "admin", "admin"); // And a new schedule with 7 day length and no gap var schedule = instance.Create.Schedule(Name("Schedule"), Duration.Parse(@"7 Days"), Duration.Parse(@"0 Days")); // And a new parent project under the root with that schedule var rootProject = instance.Get.ProjectByID(AssetID.FromToken("Scope:0")); var parentProject = instance.Create.Project(Name("Parent Project"), rootProject, DateTime.Now, schedule); // And a new child project under the parent with the same schedule var childProject = instance.Create.Project(Name("Child Project"), parentProject, DateTime.Now, schedule); // And a new helper var helper = new SystemAllProjects(instance.ApiClient.Services, instance.ApiClient.MetaModel); // And the helper is clean after a reload helper.Reload(); // When I move the child project childProject.ParentProject = rootProject; childProject.Save(); // Then the helper is dirty Assert.IsTrue(helper.IsDirty()); }
public void TestReloadIsClean() { // Given a connection to an instance of VersionOne at https://www14.v1host.com/v1sdktesting/ with user credentials for admin var instance = new V1Instance("https://www14.v1host.com/v1sdktesting/", "admin", "admin"); // When I create a new Helper var helper = new SystemAllProjects(instance.ApiClient.Services, instance.ApiClient.MetaModel); // And reload the project data helper.Reload(); // Then the helper is not dirty Assert.IsFalse(helper.IsDirty()); }