コード例 #1
0
        public void GetFunctions_ExeWithoutPdb_AttemptsToFindPdbAreLogged()
        {
            File.Exists(TestResources.X86TestsWithoutPdb).Should().BeTrue();

            var locations  = new List <SourceFileLocation>();
            var fakeLogger = new FakeLogger();

            using (
                IDiaResolver resolver = DefaultDiaResolverFactory.Instance.Create(TestResources.X86TestsWithoutPdb, "",
                                                                                  fakeLogger, true))
            {
                locations.AddRange(resolver.GetFunctions("*"));
            }

            locations.Count.Should().Be(0);
            fakeLogger.MessagesOfType(Severity.Warning)
            .Should()
            .Contain(msg => msg.Contains("Couldn't find the .pdb file"));
            fakeLogger.MessagesOfType(Severity.Info)
            .Should()
            .Contain(msg => msg.Contains("Attempts to find pdb:"));
        }
コード例 #2
0
        private void DoResolveTest(string executable, string filter, int expectedLocations, int expectedErrorMessages, bool disposeResolver = true)
        {
            var locations  = new List <SourceFileLocation>();
            var fakeLogger = new FakeLogger();

            IDiaResolver resolver = DefaultDiaResolverFactory.Instance.Create(executable, "", fakeLogger);

            locations.AddRange(resolver.GetFunctions(filter));

            if (disposeResolver)
            {
                resolver.Dispose();
            }

            locations.Count.Should().Be(expectedLocations);
            fakeLogger.MessagesOfType(Severity.Warning, Severity.Error).Count.Should().Be(expectedErrorMessages);
        }