public void Stack()
        {
            var remoteValue = RemoteValueFakeUtil.CreateSimpleInt("dummyType", 123);

            remoteValue.SetAddressOf(RemoteValueFakeUtil.CreateAddressOf(remoteValue, 0xDEADC0DE));
            Assert.That(RemoteValueExtensions.GetMemoryContextAddress(remoteValue),
                        Is.EqualTo(123));
        }
        public void Stack()
        {
            var remoteValue = RemoteValueFakeUtil.CreateSimpleInt("dummyType", 123);

            remoteValue.SetAddressOf(RemoteValueFakeUtil.CreateAddressOf(remoteValue, 0xDEADC0DE));
            Assert.That(RemoteValueExtensions.GetMemoryAddressAssignExpression(remoteValue),
                        Is.EqualTo("(*((int*)0xDEADC0DE))"));
        }
        public void Array()
        {
            var remoteValue = RemoteValueFakeUtil.CreateSimpleCharArray("dummyName",
                                                                        "dummyValue".ToCharArray());

            remoteValue.SetAddressOf(RemoteValueFakeUtil.CreateAddressOf(remoteValue, 0xDEADC0DE));
            Assert.That(RemoteValueExtensions.GetMemoryContextAddress(remoteValue),
                        Is.EqualTo(0xDEADC0DE));
        }
        public void Reference()
        {
            var remoteValue = RemoteValueFakeUtil.Create("dummyType&",
                                                         TypeFlags.IS_REFERENCE, "dummyName", "0xDEADC0DE");

            remoteValue.SetAddressOf(RemoteValueFakeUtil.CreateAddressOf(remoteValue, 0xAAAAAAAA));
            Assert.That(RemoteValueExtensions.GetMemoryContextAddress(remoteValue),
                        Is.EqualTo(0xDEADC0DE));
        }
        public void Pointer()
        {
            RemoteValueFake remoteValue =
                RemoteValueFakeUtil.CreatePointer("dummyType*", "dummyName", "0xDEADC0DE");

            remoteValue.SetAddressOf(RemoteValueFakeUtil.CreateAddressOf(remoteValue, 0xDEAD0000));
            Assert.That(RemoteValueExtensions.GetMemoryAddressAssignExpression(remoteValue),
                        Is.EqualTo("((dummyType*)0xDEADC0DE)"));
        }
        public void Array()
        {
            // We can not assign any value to array during debugging.
            var remoteValue = RemoteValueFakeUtil.CreateSimpleCharArray("dummyName",
                                                                        "dummyValue".ToCharArray());

            remoteValue.SetAddressOf(RemoteValueFakeUtil.CreateAddressOf(remoteValue, 0xDEADC0DE));
            Assert.That(RemoteValueExtensions.GetMemoryAddressAssignExpression(remoteValue),
                        Is.EqualTo(null));
        }
        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))"));
        }