Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
 public void SelectNodeObeysFirstFunctorLaw(IRoseTree <int, string> t)
 {
     Assert.Equal(t, t.SelectNode(Id));
 }