public void TestExpressionNameWhenTypeInfoIsNull()
        {
            var remoteValue = new RemoteValueFakeWithoutExpressionPath("myVar", "12358");

            remoteValue.SetValueType(DebuggerApi.ValueType.VariableLocal);
            remoteValue.SetTypeInfo(null);

            Assert.That(remoteValue.GetVariableAssignExpression(), Is.Null);
        }
        public void TestExpressionNameWhenNoAddressOf()
        {
            var remoteValue = new RemoteValueFakeWithoutExpressionPath("myVar", "12358");

            remoteValue.SetValueType(DebuggerApi.ValueType.VariableLocal);
            remoteValue.SetTypeInfo(new SbTypeStub(
                                        "int", TypeFlags.HAS_VALUE | TypeFlags.IS_SCALAR));
            remoteValue.SetAddressOf(null);

            Assert.That(remoteValue.GetVariableAssignExpression(), Is.Null);
        }
        public void TestExpressionNameForPointerType()
        {
            var remoteValue = new RemoteValueFakeWithoutExpressionPath("myVar", "0x0ddba11");

            remoteValue.SetValueType(ValueType.VariableLocal);
            remoteValue.SetTypeInfo(new SbTypeStub("CustomType*", TypeFlags.IS_POINTER));
            remoteValue.SetAddressOf(RemoteValueFakeUtil.CreateSimpleLong("$0", 0xDEADBEEF));

            Assert.That(remoteValue.GetVariableAssignExpression(),
                        Is.EqualTo("((CustomType*)0x0ddba11)"));
        }
        public void TestExpressionNameForScalarType()
        {
            var remoteValue = new RemoteValueFakeWithoutExpressionPath("myVar", "12358");

            remoteValue.SetValueType(DebuggerApi.ValueType.VariableLocal);
            remoteValue.SetTypeInfo(
                new SbTypeStub("CustomType", TypeFlags.HAS_VALUE | TypeFlags.IS_SCALAR));
            remoteValue.SetAddressOf(RemoteValueFakeUtil.CreateAddressOf(remoteValue, 0xDEADBEEF));

            Assert.That(remoteValue.GetVariableAssignExpression(),
                        Is.EqualTo("(*((CustomType*)0xDEADBEEF))"));
        }
        public void TestExpressionNameForReferenceType()
        {
            var remoteValue = new RemoteValueFakeWithoutExpressionPath("myVar", "0x0ddba11");

            remoteValue.SetValueType(DebuggerApi.ValueType.VariableLocal);
            remoteValue.SetTypeInfo(
                new SbTypeStub("CustomType&", TypeFlags.HAS_VALUE | TypeFlags.IS_REFERENCE));
            remoteValue.SetAddressOf(RemoteValueFakeUtil.CreateSimpleLong("$0", 0xDEADBEEF));

            Assert.That(remoteValue.GetVariableAssignExpression(),
                        Is.EqualTo("(*((CustomType*)0x0ddba11))"));
        }