public static void AssertNamed(this ITicResults results, ITypeState type, params string[] varNames) { foreach (var varName in varNames) { Assert.AreEqual(type, results.GetVariableNode(varName).GetNonReference().State); } }
public static void AssertAreGenerics(this ITicResults result, TicNode targetGenericNode, params string[] varNames) { foreach (var varName in varNames) { Assert.AreEqual(targetGenericNode, result.GetVariableNode(varName).GetNonReference()); } }
public static void AssertNamed(this ITicResults results, ITypeState expectedState, params string[] varNames) { foreach (var varName in varNames) { AssertNodeStateEqualToState( expected: expectedState, actual: results.GetVariableNode(varName).State, id: varName); } }
public static void AssertNamedEqualToArrayOf(this ITicResults results, object typeOrNode, params string[] varNames) { foreach (var varName in varNames) { var node = results.GetVariableNode(varName).GetNonReference(); if (node.State is StateArray array) { var element = array.ElementNode; if (typeOrNode is StatePrimitive concrete) { Assert.IsTrue(concrete.Equals(element.State)); } else { Assert.AreEqual(typeOrNode, array.ElementNode); } } else { Assert.Fail(); } } }
public ITicNodeState GetVariableType(string name) => _bodyTypeSolving.GetVariableNode(name).State;