public void SecondFunctorLawHoldsForSelectNode(IRoseTree <int, string> t) { char f(bool b) => b ? 'T' : 'F'; bool g(int i) => i % 2 == 0; Assert.Equal( t.SelectNode(x => f(g(x))), t.SelectNode(g).SelectNode(f)); }
public void ConsistencyLawHolds(IRoseTree <int, string> t) { DateTime f(int i) => new DateTime(i); bool g(string s) => string.IsNullOrWhiteSpace(s); Assert.Equal(t.SelectBoth(f, g), t.SelectLeaf(g).SelectNode(f)); Assert.Equal( t.SelectNode(f).SelectLeaf(g), t.SelectLeaf(g).SelectNode(f)); }
public void SelectNodeObeysFirstFunctorLaw(IRoseTree <int, string> t) { Assert.Equal(t, t.SelectNode(Id)); }