public void TraverseDownSeparateBranch() { InheritanceHierarchy ih = init(); var res = ih.traverseDown("F"); Assert.AreEqual(res, Set("F", "G")); }
public void TraverseDownDiamondSide() { InheritanceHierarchy ih = init(); var res = ih.traverseDown("B"); Assert.AreEqual(res, Set("B", "D", "E")); }
public void TraverseUpDiamond() { InheritanceHierarchy ih = init(); var res = ih.traverseUp("D"); Assert.AreEqual(res, Set("D", "B", "C", "A")); }
public void TraverseUpRoot() { InheritanceHierarchy ih = init(); var res = ih.traverseUp("A"); Assert.AreEqual(res, Set("A")); }
public void TraverseDownLeaf() { InheritanceHierarchy ih = init(); var res = ih.traverseDown("G"); Assert.AreEqual(res, Set("G")); }
public void MultipleResovle() { (IType[] types, Function[] scope) = init(); InheritanceHierarchy ih = new InheritanceHierarchy(Arr.create <IType>(types)); FunctionResolver fr = new FunctionResolver(ih, new Seq <Function>(scope)); var res = fr.resolve(new Function("B_toZ_", new[] { types[1] }, new[] { types[6] })); var correct = new Set <string>(new[] { "AtoZ", "BtoZ" }); match(from someres in res select someres.name, Some: v => Assert.AreEqual(v, correct), None: () => throw new FunctionResolutionError("Function resolution return empty set, when should not")); }
public FunctionResolver(InheritanceHierarchy hier, Seq <Function> funcScope) { this.hier = hier; scope = funcScope; }