private List <NodeEvaluationResult> GetVariables(NodeStackFrame stackFrame, JsonArray variables)
        {
            var results = new List <NodeEvaluationResult>(variables.Count);

            for (int i = 0; i < variables.Count; i++)
            {
                var variableProvider        = new NodeBacktraceVariable(stackFrame, variables[i]);
                NodeEvaluationResult result = _evaluationResultFactory.Create(variableProvider);
                results.Add(result);
            }
            return(results.ToList());
        }
        public void CreateBacktraceVariableWithNullStackFrame() {
            // Arrange
            JObject json = SerializationTestData.GetBacktraceJsonObject();
            Exception exception = null;
            NodeBacktraceVariable result = null;

            // Act
            try {
                result = new NodeBacktraceVariable(null, json);
            } catch (Exception e) {
                exception = e;
            }

            // Assert
            Assert.IsNull(result);
            Assert.IsNotNull(exception);
            Assert.IsInstanceOfType(exception, typeof (ArgumentNullException));
        }
        public void CreateBacktraceVariableWithNullName() {
            // Arrange
            JObject json = SerializationTestData.GetBacktraceJsonObjectWithNullName();
            var stackFrame = new NodeStackFrame(0);

            // Act
            var result = new NodeBacktraceVariable(stackFrame, json);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(NodePropertyAttributes.None, result.Attributes);
            Assert.IsNull(result.Class);
            Assert.AreEqual(21, result.Id);
            Assert.AreEqual(NodeVariableType.AnonymousVariable, result.Name);
            Assert.IsNull(result.Parent);
            Assert.AreEqual(stackFrame, result.StackFrame);
            Assert.IsNull(result.Text);
            Assert.AreEqual(NodePropertyType.Normal, result.Type);
            Assert.AreEqual("boolean", result.TypeName);
        }
        public void CreateBacktraceVariableWithNullJson() {
            // Arrange
            var stackFrame = new NodeStackFrame(0);
            Exception exception = null;
            NodeBacktraceVariable result = null;

            // Act
            try {
                result = new NodeBacktraceVariable(stackFrame, null);
            } catch (Exception e) {
                exception = e;
            }

            // Assert
            Assert.IsNull(result);
            Assert.IsNotNull(exception);
            Assert.IsInstanceOfType(exception, typeof (ArgumentNullException));
        }
 private List<NodeEvaluationResult> GetVariables(NodeStackFrame stackFrame, JsonArray variables) {
     var results = new List<NodeEvaluationResult>(variables.Count);
     for (int i = 0; i < variables.Count; i++) {
         var variableProvider = new NodeBacktraceVariable(stackFrame, variables[i]);
         NodeEvaluationResult result = _evaluationResultFactory.Create(variableProvider);
         results.Add(result);
     }
     return results.ToList();
 }