Beispiel #1
0
        public void CheckVariablesCount(string caller_trace, Int64 frameId, string ScopeName, int VarCount)
        {
            ScopesRequest scopesRequest = new ScopesRequest();

            scopesRequest.arguments.frameId = frameId;
            var ret = VSCodeDebugger.Request(scopesRequest);

            Assert.True(ret.Success, @"__FILE__:__LINE__" + "\n" + caller_trace);

            ScopesResponse scopesResponse =
                JsonConvert.DeserializeObject <ScopesResponse>(ret.ResponseStr);

            foreach (var Scope in scopesResponse.body.scopes)
            {
                if (Scope.name == ScopeName)
                {
                    Assert.True(VarCount == Scope.namedVariables ||
                                (VarCount == 0 && null == Scope.namedVariables),
                                @"__FILE__:__LINE__" + "\n" + caller_trace);
                    return;
                }
            }

            throw new ResultNotSuccessException(@"__FILE__:__LINE__" + "\n" + caller_trace);
        }
Beispiel #2
0
        public int GetVariablesReference(string caller_trace, Int64 frameId, string ScopeName)
        {
            ScopesRequest scopesRequest = new ScopesRequest();

            scopesRequest.arguments.frameId = frameId;
            var ret = VSCodeDebugger.Request(scopesRequest);

            Assert.True(ret.Success, @"__FILE__:__LINE__" + "\n" + caller_trace);

            ScopesResponse scopesResponse =
                JsonConvert.DeserializeObject <ScopesResponse>(ret.ResponseStr);

            foreach (var Scope in scopesResponse.body.scopes)
            {
                if (Scope.name == ScopeName)
                {
                    return(Scope.variablesReference == null ? 0 : (int)Scope.variablesReference);
                }
            }

            throw new ResultNotSuccessException(@"__FILE__:__LINE__" + "\n" + caller_trace);
        }
Beispiel #3
0
        public static int GetVariablesReference(Int64 frameId, string ScopeName)
        {
            ScopesRequest scopesRequest = new ScopesRequest();

            scopesRequest.arguments.frameId = frameId;
            var ret = VSCodeDebugger.Request(scopesRequest);

            Assert.True(ret.Success);

            ScopesResponse scopesResponse =
                JsonConvert.DeserializeObject <ScopesResponse>(ret.ResponseStr);

            foreach (var Scope in scopesResponse.body.scopes)
            {
                if (Scope.name == ScopeName)
                {
                    return(Scope.variablesReference == null ? 0 : (int)Scope.variablesReference);
                }
            }

            throw new NetcoreDbgTestCore.ResultNotSuccessException();
        }
Beispiel #4
0
        public static void CheckVariablesCount(Int64 frameId, string ScopeName, int VarCount)
        {
            ScopesRequest scopesRequest = new ScopesRequest();

            scopesRequest.arguments.frameId = frameId;
            var ret = VSCodeDebugger.Request(scopesRequest);

            Assert.True(ret.Success);

            ScopesResponse scopesResponse =
                JsonConvert.DeserializeObject <ScopesResponse>(ret.ResponseStr);

            foreach (var Scope in scopesResponse.body.scopes)
            {
                if (Scope.name == ScopeName)
                {
                    Assert.True(VarCount == Scope.namedVariables ||
                                (VarCount == 0 && null == Scope.namedVariables));
                    return;
                }
            }

            throw new NetcoreDbgTestCore.ResultNotSuccessException();
        }