public void DoesNotBlockItself() { var comb = new SyncComb( new RamComb("my-comb") ); Parallel.For(0, Environment.ProcessorCount << 4, (i) => { var content = Guid.NewGuid().ToString(); comb.Xocument("synced") .Modify( new Directives() .Xpath("/synced") .Set(content) ); Assert.NotEmpty(comb.Xocument("synced").Value("/synced/text()", "")); }); }
public void WorksWithRamXocument() { var comb = new SyncComb( new RamComb("myRamComb") ); var xoc = comb.Xocument("test"); xoc.Modify(new Directives().Xpath("/test").Add("root").Add("items").Add("item").Attr("id", "123")); Assert.Equal("123", xoc.Values("/test/root/items/item/@id")[0]); }
public void XocumentAndCellDoNotConflict() { var comb = new SyncComb( new RamComb("my-comb") ); Parallel.For(0, Environment.ProcessorCount << 4, (i) => { var xoc = comb.Xocument("synced"); xoc.Node(); Assert.Equal("<synced />", xoc.Node().ToString()); var cell = comb.Cell("synced"); cell.Update(new InputOf($"<synced />")); Assert.Equal($"<synced />", new TextOf(cell.Content()).AsString()); }); }