public void HasChangesTest() { LaunchGroup group = new LaunchGroup(); LaunchGroup childGroup = new LaunchGroup(); Launcher childLauncher = new Launcher(); Assert.IsFalse(group.HasChanges); group.Name = "a"; Assert.IsTrue(group.HasChanges, "Changing Name should cause HasChanges to be true"); group.ClearAllHasChanges(); group.EnvironmentVariables.Add(new EnvironmentVariable("A", "A")); Assert.IsTrue(group.HasChanges, "New environment variables should cause HasChanges to be true"); group.ClearAllHasChanges(); group.EnvironmentVariables["A"] = "B"; Assert.IsTrue(group.HasChanges, "Updating environment variables should cause HasChanges to be true"); group.ClearAllHasChanges(); group.Groups.Add(childGroup); Assert.IsTrue(group.HasChanges, "New child groups should cause HasChages to be true"); group.ClearAllHasChanges(); childGroup.Name = "a"; Assert.IsTrue(group.HasChanges, "Changes to child groups should cause HasChanges to be true"); group.ClearAllHasChanges(); group.Launchers.Add(childLauncher); Assert.IsTrue(group.HasChanges, "New child launchers should cause HasChanges to be true"); group.ClearAllHasChanges(); childLauncher.Name = "A"; Assert.IsTrue(group.HasChanges, "Changes to child launchers should cause HasChanges to be true"); }
public void ClearAllHasChangesTest() { var group = new LaunchGroup(null, new[] { new LaunchGroup(null, new[] { new LaunchGroup {HasChanges = true}, }, new[] { new Launcher {HasChanges = true}, }) {HasChanges = true}, }, new[] { new Launcher {HasChanges = true}, }) {HasChanges = true}; Assert.IsTrue(group.HasChanges, "All Groups and Launchers should have changes"); Assert.IsTrue(group.Groups[0].HasChanges, "All Groups and Launchers should have changes"); Assert.IsTrue(group.Groups[0].Groups[0].HasChanges, "All Groups and Launchers should have changes"); Assert.IsTrue(group.Groups[0].Launchers[0].HasChanges, "All Groups and Launchers should have changes"); Assert.IsTrue(group.Launchers[0].HasChanges, "All Groups and Launchers should have changes"); group.ClearAllHasChanges(); Assert.IsFalse(group.HasChanges, "All Groups and Launchers should not have changes"); Assert.IsFalse(group.Groups[0].HasChanges, "All Groups and Launchers should not have changes"); Assert.IsFalse(group.Groups[0].Groups[0].HasChanges, "All Groups and Launchers should not have changes"); Assert.IsFalse(group.Groups[0].Launchers[0].HasChanges, "All Groups and Launchers should not have changes"); Assert.IsFalse(group.Launchers[0].HasChanges, "All Groups and Launchers should not have changes"); }