public void RemovedLocal() { using var apApplied = new TemporaryFlagFile("ap-applied"); using var apNotApplied = new TemporaryFlagFile("ap-not-applied"); var appListServer = new AppList { Entries = { new AppEntry { InterfaceUri = FeedTest.Test1Uri, AccessPoints = new AccessPointList{ Entries ={ new MockAccessPoint { ApplyFlagPath = apApplied, UnapplyFlagPath = apNotApplied } } } } } }; TestSync(SyncResetMode.None, new AppList(), appListServer.Clone(), appListServer); apApplied.Set.Should().BeFalse(because: "Locally removed access point should not be reapplied"); apNotApplied.Set.Should().BeFalse(because: "Locally removed access point should not be not-applied again"); }
public void TestRemovedRemote() { using (var apApplied = new TemporaryFlagFile("ap-applied")) using (var apUnapplied = new TemporaryFlagFile("ap-unapplied")) { var appListLocal = new AppList { Entries = { new AppEntry { InterfaceUri = FeedTest.Test1Uri, AccessPoints = new AccessPointList {Entries = {new MockAccessPoint {ApplyFlagPath = apApplied, UnapplyFlagPath = apUnapplied}}} } } }; TestSync(SyncResetMode.None, appListLocal, appListLocal.Clone(), new AppList()); Assert.IsFalse(apApplied.Set, "Removed access point should not be reapplied"); Assert.IsTrue(apUnapplied.Set, "Removed point should be unapplied"); } }
private static void TestClone(AppList appList) { var appList2 = appList.Clone(); // Ensure data stayed the same appList2.Should().Be(appList, because: "Cloned objects should be equal."); appList2.GetHashCode().Should().Be(appList.GetHashCode(), because: "Cloned objects' hashes should be equal."); appList2.Should().NotBeSameAs(appList, because: "Cloning should not return the same reference."); }
public void TestRemovedLocal() { using (var apApplied = new TemporaryFlagFile("ap-applied")) using (var apUnapplied = new TemporaryFlagFile("ap-unapplied")) { var appListServer = new AppList { Entries = { new AppEntry { InterfaceUri = FeedTest.Test1Uri, AccessPoints = new AccessPointList {Entries = {new MockAccessPoint {ApplyFlagPath = apApplied, UnapplyFlagPath = apUnapplied}}} } } }; TestSync(SyncResetMode.None, new AppList(), appListServer.Clone(), appListServer); apApplied.Set.Should().BeFalse(because: "Locally removed access point should not be reapplied"); apUnapplied.Set.Should().BeFalse(because: "Locally removed access point should not be unapplied again"); } }