Example #1
0
        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));
        }
Example #2
0
        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));
        }
Example #3
0
        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);
        }