public void RemovesProp() { using (var temp = new TempDirectory()) { var memory = new FileMnemonic(temp.Value().FullName); var comb = new FileComb("my-comb", memory); comb.Props().Refined("name", "value", "value2"); comb.Props().Refined("name"); Assert.Empty( comb.Props().Names() ); } }
public void HasArrayProps() { using (var temp = new TempDirectory()) { var memory = new FileMnemonic(temp.Value().FullName); var comb = new FileComb("my-comb", memory); comb.Props().Refined("name", "value", "value2"); Assert.Equal( new ManyOf("value", "value2"), comb.Props().Values("name") ); } }
public void MemorizesXml() { using (var temp = new TempDirectory()) { var mem = new FileMnemonic(temp.Value().FullName); using (var xoc = new MemorizedComb("beverage", mem).Xocument("coke.xml")) { xoc.Modify(new Directives().Xpath("/coke").Add("light").Set("yes please")); } mem = new FileMnemonic(temp.Value().FullName); using (var xoc = new MemorizedComb("beverage", mem).Xocument("coke.xml")) { Assert.Equal( "yes please", xoc.Value("/coke/light/text()", "") ); } } }
public void MemorizesProps() { using (var temp = new TempDirectory()) { var mem = new FileMnemonic(temp.Value().FullName); new TextIndex( "beverage", mem ).Add("fritz-kola"); mem.Props("beverage", "fritz-kola").Refined("light", "yes please"); mem = new FileMnemonic(temp.Value().FullName); Assert.Equal( "yes please", mem.Props("beverage", "fritz-kola").Value("light") ); } }
public void MemorizesBinary() { using (var temp = new TempDirectory()) { var mem = new FileMnemonic(temp.Value().FullName); using (var pepsi = new MemorizedComb("beverage", mem).Cell("pepsi")) { pepsi.Update(new InputOf("Empty")); } mem = new FileMnemonic(temp.Value().FullName); using (var pepsi = new MemorizedComb("beverage", mem).Cell("pepsi")) { Assert.Equal( "Empty", new TextOf( new InputOf(pepsi.Content()) ).AsString() ); } } }