Exemplo n.º 1
0
        public void CreateLookupVariableWithNullJsonReferences()
        {
            // Arrange
            var                   parent    = new NodeEvaluationResult(0, null, null, null, null, null, NodeExpressionType.None, null);
            JObject               json      = SerializationTestData.GetLookupJsonPrototype();
            Exception             exception = null;
            NodePrototypeVariable result    = null;

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

            // Assert
            Assert.IsNull(result);
            Assert.IsNotNull(exception);
            Assert.IsInstanceOfType(exception, typeof(ArgumentNullException));
        }
Exemplo n.º 2
0
        public void CreateLookupVariableWithNullParent()
        {
            // Arrange
            JObject json = SerializationTestData.GetLookupJsonPrototype();
            Dictionary <int, JToken> references = SerializationTestData.GetLookupJsonReferences();

            // Act
            var result = new NodePrototypeVariable(null, json, references);

            // Assert
            Assert.IsNotNull(result);
            Assert.AreEqual(NodePropertyAttributes.DontEnum, result.Attributes);
            Assert.AreEqual(NodeVariableType.Object, result.Class);
            Assert.AreEqual(4, result.Id);
            Assert.AreEqual(NodeVariableType.Prototype, result.Name);
            Assert.IsNull(result.Parent);
            Assert.IsNull(result.StackFrame);
            Assert.AreEqual("#<Object>", result.Text);
            Assert.AreEqual(NodePropertyType.Normal, result.Type);
            Assert.AreEqual("object", result.TypeName);
            Assert.IsNull(result.Value);
        }