Example #1
0
        public void CreateSourceLocation_NoFrames()
        {
            var exception = new Exception();
            var location  = ERUtils.CreateSourceLocation(exception);

            Assert.Equal(s_emptyLocation, location);
        }
Example #2
0
        public void CreateSourceLocation()
        {
            Exception exception;

            try
            {
                throw new Exception();
            }
            catch (Exception e)
            {
                exception = e;
            }

            var location = ERUtils.CreateSourceLocation(exception);

            if (ErrorReportingUtils.IsWindows)
            {
                Assert.NotEmpty(location.FilePath);
                Assert.True(location.LineNumber > 0);
            }
            Assert.Equal(nameof(CreateSourceLocation), location.FunctionName);
        }
Example #3
0
        public void CreateSourceLocation_Null()
        {
            var location = ERUtils.CreateSourceLocation(null);

            Assert.Equal(s_emptyLocation, location);
        }