public void ListSimple() { using (var tempFile = new TemporaryFile()) using (var store2 = new ListStore<int>(VirtualFileSystem.OpenStream(tempFile.Path, VirtualFileMode.OpenOrCreate, VirtualFileAccess.ReadWrite, VirtualFileShare.ReadWrite))) using (var store1 = new ListStore<int>(VirtualFileSystem.OpenStream(tempFile.Path, VirtualFileMode.OpenOrCreate, VirtualFileAccess.ReadWrite, VirtualFileShare.ReadWrite))) { store1.UseTransaction = true; // Add a value to store2 and saves it store2.AddValue(1); store2.Save(); // Add a value to store1 without saving store1.AddValue(2); Assert.AreEqual(new[] { 2 }, store1.GetValues()); // Check that store1 contains value from store2 first store1.LoadNewValues(); Assert.AreEqual(new[] { 1, 2 }, store1.GetValues()); // Save and check that results didn't change store1.Save(); Assert.AreEqual(new[] { 1, 2 }, store1.GetValues()); } }
public void ListSimple() { using (var tempFile = new TemporaryFile()) using (var store2 = new ListStore <int>(VirtualFileSystem.OpenStream(tempFile.Path, VirtualFileMode.OpenOrCreate, VirtualFileAccess.ReadWrite, VirtualFileShare.ReadWrite))) using (var store1 = new ListStore <int>(VirtualFileSystem.OpenStream(tempFile.Path, VirtualFileMode.OpenOrCreate, VirtualFileAccess.ReadWrite, VirtualFileShare.ReadWrite))) { store1.UseTransaction = true; // Add a value to store2 and saves it store2.AddValue(1); store2.Save(); // Add a value to store1 without saving store1.AddValue(2); Assert.AreEqual(new[] { 2 }, store1.GetValues()); // Check that store1 contains value from store2 first store1.LoadNewValues(); Assert.AreEqual(new[] { 1, 2 }, store1.GetValues()); // Save and check that results didn't change store1.Save(); Assert.AreEqual(new[] { 1, 2 }, store1.GetValues()); } }
private void RegisterCommandResult(ListStore <CommandResultEntry> commandResultEntries, CommandResultEntry result, ResultStatus status) { //foreach (var outputObject in result.OutputObjects.Where(outputObject => outputObject.Key.Type == UrlType.Internal)) //{ // builderContext.AssetIndexMap[outputObject.Key.Path] = outputObject.Value; //} Result = result; // Only save to build cache if compilation was done and successful if (status == ResultStatus.Successful) { commandResultEntries.AddValue(result); } }
private void RegisterCommandResult(ListStore<CommandResultEntry> commandResultEntries, CommandResultEntry result, ResultStatus status) { //foreach (var outputObject in result.OutputObjects.Where(outputObject => outputObject.Key.Type == UrlType.Internal)) //{ // builderContext.AssetIndexMap[outputObject.Key.Path] = outputObject.Value; //} Result = result; // Only save to build cache if compilation was done and successful if (status == ResultStatus.Successful) { commandResultEntries.AddValue(result); } }