Skip to content

Commit

Permalink
chore(tasks): update tasks configuration and remove solution file
Browse files Browse the repository at this point in the history
- Refactors the existing VS Code tasks configuration to add separate tasks for building OaiUI and UnitTests projects.
- Removes the Visual Studio solution file, potentially reducing dependency on Visual Studio-specific project management.
- Updates unit tests to accommodate an additional parameter for excluded folders in the DocXHandler functionality.
  • Loading branch information
zzt108 committed Dec 24, 2024
1 parent 562d88c commit 217fe6e
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 44 deletions.
90 changes: 51 additions & 39 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,53 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/OaiUI/oaiUI.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/OaiUI/oaiUI.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/OaiUI/oaiUI.csproj"
],
"problemMatcher": "$msCompile"
}
]
"version": "2.0.0",
"tasks": [
{
"label": "build OaiUI",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/OaiUI/oaiUI.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "build UnitTests",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/UnitTests/UnitTests.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/OaiUI/oaiUI.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary;ForceNoAlign"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/OaiUI/oaiUI.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
12 changes: 7 additions & 5 deletions UnitTests/DocXHandlerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class DocXHandlerTests
private string testFolderPath;
private string outputDocxPath;
private List<string> excludedFiles;
private List<string> excludedFolders;

[SetUp]
public void Setup()
Expand All @@ -25,6 +26,7 @@ public void Setup()

// Initialize excluded files list
excludedFiles = new List<string>();
excludedFolders = new List<string>();
}

[Test]
Expand All @@ -39,7 +41,7 @@ public void ConvertFilesToDocx_MultipleFiles_ShouldIncludeAllInDocx()
File.WriteAllText(textFilePath3, "Content of file 3");

// Act
DocXHandler.DocXHandler.ConvertFilesToDocx(testFolderPath, outputDocxPath, excludedFiles);
DocXHandler.DocXHandler.ConvertFilesToDocx(testFolderPath, outputDocxPath, excludedFiles, excludedFolders);

// Assert
File.Exists(outputDocxPath).Should().BeTrue();
Expand Down Expand Up @@ -70,7 +72,7 @@ public void Cleanup()
public void ConvertFilesToDocx_EmptyFolder_ShouldCreateEmptyDocx()
{
// Act
DocXHandler.DocXHandler.ConvertFilesToDocx(testFolderPath, outputDocxPath, excludedFiles);
DocXHandler.DocXHandler.ConvertFilesToDocx(testFolderPath, outputDocxPath, excludedFiles, excludedFolders);

// Assert
File.Exists(outputDocxPath).Should().BeTrue();
Expand All @@ -91,7 +93,7 @@ public void ConvertFilesToDocx_NonTextFiles_ShouldNotIncludeInDocx()
File.WriteAllBytes(nonTextFilePath, new byte[] { 0, 1, 2 }); // Create a dummy image file

// Act
DocXHandler.DocXHandler.ConvertFilesToDocx(testFolderPath, outputDocxPath, excludedFiles);
DocXHandler.DocXHandler.ConvertFilesToDocx(testFolderPath, outputDocxPath, excludedFiles, excludedFolders);

// Assert
File.Exists(outputDocxPath).Should().BeTrue();
Expand Down Expand Up @@ -122,7 +124,7 @@ public void ConvertFilesToDocx_TextFile_ShouldIncludeInDocx()
File.WriteAllText(textFilePath, "Hello, World!");

// Act
DocXHandler.DocXHandler.ConvertFilesToDocx(testFolderPath, outputDocxPath, excludedFiles);
DocXHandler.DocXHandler.ConvertFilesToDocx(testFolderPath, outputDocxPath, excludedFiles, excludedFolders);

// Assert
File.Exists(outputDocxPath).Should().BeTrue();
Expand All @@ -145,7 +147,7 @@ public void ConvertFilesToDocx_EmptyFile_ShouldNotIncludeInDocx()
File.WriteAllText(emptyFilePath, ""); // Create an empty file

// Act
DocXHandler.DocXHandler.ConvertFilesToDocx(testFolderPath, outputDocxPath, excludedFiles);
DocXHandler.DocXHandler.ConvertFilesToDocx(testFolderPath, outputDocxPath, excludedFiles, excludedFolders);

// Assert
File.Exists(outputDocxPath).Should().BeTrue();
Expand Down
File renamed without changes.

0 comments on commit 217fe6e

Please sign in to comment.