Sorry, there's nothing at this address.
9 |8 | Swapping to Development environment will display more detailed information about the error that occurred. 9 |
10 |11 | The Development environment shouldn't be enabled for deployed applications. 12 | It can result in displaying sensitive information from exceptions to end users. 13 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 14 | and restarting the app. 15 |
-------------------------------------------------------------------------------- /src/CodeIndex.Test/Files/FilePathHelperTest.cs: -------------------------------------------------------------------------------- 1 | using CodeIndex.Files; 2 | using NUnit.Framework; 3 | 4 | namespace CodeIndex.Test 5 | { 6 | public class FilePathHelperTest 7 | { 8 | [Test] 9 | public void TestGetPaths() 10 | { 11 | var results = FilePathHelper.GetPaths(new[] { "\\BIN\\1.txt", "/home/etc" }, true); 12 | Assert.That(results, Is.EquivalentTo(new[] { "/BIN/1.TXT", "/HOME/ETC" })); 13 | 14 | results = FilePathHelper.GetPaths(new[] { "\\BIN\\1.txt", "/home/etc" }, false); 15 | Assert.That(results, Is.EquivalentTo(new[] { "\\BIN\\1.TXT", "\\HOME\\ETC" })); 16 | 17 | Assert.That(FilePathHelper.GetPaths(null, true), Is.Null); 18 | Assert.That(FilePathHelper.GetPaths(null, false), Is.Null); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/CodeIndex.Test/Common/CodeSourceWithMatchedLineTest.cs: -------------------------------------------------------------------------------- 1 | using CodeIndex.Common; 2 | using Newtonsoft.Json; 3 | using NUnit.Framework; 4 | 5 | namespace CodeIndex.Test 6 | { 7 | public class CodeSourceWithMatchedLineTest 8 | { 9 | [Test] 10 | public void TestConstructor() 11 | { 12 | var codeWithMatchedLine = new CodeSourceWithMatchedLine(new CodeSource() { Content = "ABD" }, 1, "ABC"); 13 | Assert.Multiple(() => 14 | { 15 | Assert.That(codeWithMatchedLine.MatchedLine, Is.EqualTo(1)); 16 | Assert.That(codeWithMatchedLine.MatchedContent, Is.EqualTo("ABC")); 17 | Assert.That(codeWithMatchedLine.CodeSource.Content, Is.EqualTo("ABD")); 18 | }); 19 | 20 | Assert.DoesNotThrow(() => new CodeSourceWithMatchedLine()); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/CodeIndex.Test/BaseTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using CodeIndex.Common; 4 | using CodeIndex.IndexBuilder; 5 | using CodeIndex.MaintainIndex; 6 | using Lucene.Net.QueryParsers.Classic; 7 | using NUnit.Framework; 8 | 9 | namespace CodeIndex.Test 10 | { 11 | public class BaseTest : BaseTestLight 12 | { 13 | public CodeIndexConfiguration Config => new CodeIndexConfiguration 14 | { 15 | LuceneIndex = TempIndexDir 16 | }; 17 | 18 | protected string TempConfigDir => Path.Combine(TempIndexDir, CodeIndexConfiguration.ConfigurationIndexFolder); 19 | 20 | [SetUp] 21 | protected override void SetUp() 22 | { 23 | base.SetUp(); 24 | } 25 | 26 | [TearDown] 27 | protected override void TearDown() 28 | { 29 | base.TearDown(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/CodeIndex.IndexBuilder/CodeIndex.IndexBuilder.csproj: -------------------------------------------------------------------------------- 1 |@Result17 |
| File Name | 6 |Match Info | 7 |File Path | 8 |File Extension | 9 |Details | 10 |
|---|---|---|---|---|
| @item.FileName | 19 |
20 | @((MarkupString)item.Content)21 | |
22 | 23 | 24 | @item.FilePath?.SubStringSafeWithEllipsis(item.FilePath.Length - 50, 50) 25 | | 26 |@item.FileExtension | 27 |28 | Details 29 | | 30 |
| Empty | 37 |||||
| File Name | 6 |Match Line | 7 |Match Info | 8 |File Path | 9 |File Extension | 10 |Details | 11 |
|---|---|---|---|---|---|
| @item.CodeSource.FileName | 20 |@item.MatchedLine | 21 |
22 | @((MarkupString)item.MatchedContent)23 | |
24 | 25 | @item.CodeSource.FilePath?.SubStringSafeWithEllipsis(item.CodeSource.FilePath.Length - 50, 50) 26 | | 27 |@item.CodeSource.FileExtension | 28 |29 | Details 30 | | 31 |
| Empty | 38 ||||||
Extension: @Source?.FileExtension | Index Date: @Source?.IndexDate | Last Write Time Utc: @Source?.LastWriteTimeUtc
12 |File Path: @Source?.FilePath
14 |Content:
16 |17 |
@((MarkupString)Source?.Content)18 | 19 |