Esempio n. 1
0
        public void LongValues(long value, bool isTruthy)
        {
            var remoteValue = RemoteValueFakeUtil.CreateSimpleLong("myVar", value);
            var varInfo     = varInfoBuilder.Create(remoteValue);

            Assert.That(varInfo.IsTruthy, Is.EqualTo(isTruthy));
        }
        public void TestExpressionNameWhenFullnameExists()
        {
            var remoteValue = RemoteValueFakeUtil.CreateSimpleInt("myVar", 12358);

            remoteValue.SetValueType(DebuggerApi.ValueType.VariableLocal);
            remoteValue.SetAddressOf(RemoteValueFakeUtil.CreateSimpleLong("$0", 0xDEADBEEF));

            Assert.That(remoteValue.GetVariableAssignExpression(), Is.EqualTo("myVar"));
        }
        public void TestExpressionNameForInvalidValueType()
        {
            var remoteValue = new RemoteValueFake("myVar", "12358");

            remoteValue.SetValueType(DebuggerApi.ValueType.Invalid);
            remoteValue.SetTypeInfo(
                new SbTypeStub("int", TypeFlags.HAS_VALUE | TypeFlags.IS_SCALAR));
            remoteValue.SetAddressOf(RemoteValueFakeUtil.CreateSimpleLong("$0", 0xDEADBEEF));

            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 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))"));
        }