Esempio n. 1
0
 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);
     }
 }
Esempio n. 2
0
 public static void AssertAreGenerics(this ITicResults result, TicNode targetGenericNode,
                                      params string[] varNames)
 {
     foreach (var varName in varNames)
     {
         Assert.AreEqual(targetGenericNode, result.GetVariableNode(varName).GetNonReference());
     }
 }
Esempio n. 3
0
 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);
     }
 }
Esempio n. 4
0
 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();
         }
     }
 }
Esempio n. 5
0
 public ITicNodeState GetVariableType(string name)
 => _bodyTypeSolving.GetVariableNode(name).State;