Skip to content

Commit

Permalink
Feat #28: Create manual-testing solution
Browse files Browse the repository at this point in the history
- src/BlogMan.Test/BlogMan.Test.csproj: Add test-case adoption
- src/BlogMan.Test/Program.cs: Add manual-testing line
- src/BlogMan.Test/Resources/.gitignore: GIT should ignore test result
- src/BlogMan.Test/Resoruces/**/*.*: Add test-case
- src/BlogMan.Test/Resources/test.json: Add test-case
- src/BlogMan/Program.cs: Expose entrypoint
  • Loading branch information
Sharp0802 committed Oct 4, 2023
1 parent 154ec58 commit b47a65a
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 3 deletions.
11 changes: 11 additions & 0 deletions src/BlogMan.Test/BlogMan.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<None Include="Resources/**/*.*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BlogMan\BlogMan.csproj"/>
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions src/BlogMan.Test/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

await BlogMan.Program.Main(
"build",
"--project",
"Resources/test.json");
2 changes: 2 additions & 0 deletions src/BlogMan.Test/Resources/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
site/
19 changes: 19 additions & 0 deletions src/BlogMan.Test/Resources/post/test-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
LCID: ko-kr
Layout: default
Title: Welcome!
Timestamps:
- 2023-10-04
- 2023-10-05
- 2023-10-06
Topic: [
"test-topic-0",
"test-topic-1"
]
---

## Hello There!

[test-link-1](ref::test/test-post-1.md)

[test-link-2](ref::test/test/test-post-2.md)
19 changes: 19 additions & 0 deletions src/BlogMan.Test/Resources/post/test0/test-post-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
LCID: ko-kr
Layout: default
Title: Welcome!
Timestamps:
- 2023-10-04
- 2023-10-05
- 2023-10-06
Topic: [
"test-topic-0",
"test-topic-1"
]
---

## Hello There!

[test-link-1](ref::test/test-post-1.md)

[test-link-2](ref::test/test/test-post-2.md)
19 changes: 19 additions & 0 deletions src/BlogMan.Test/Resources/post/test0/test1/test-post-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
LCID: ko-kr
Layout: default
Title: Welcome!
Timestamps:
- 2023-10-04
- 2023-10-05
- 2023-10-06
Topic: [
"test-topic-0",
"test-topic-1"
]
---

## Hello There!

[test-link-1](ref::test0/test-post-1.md)

[test-link-2](ref::test0/test1/test-post-2.md)
20 changes: 20 additions & 0 deletions src/BlogMan.Test/Resources/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"Info": {
"Name": "sharp0802-github-io",
"ApiVersion": "1.0.0.0",
"RootUri": "https://sharp0802.github.io/",
"PostDirectory": "post/",
"LayoutDirectory": "layout/",
"SiteDirectory": "docs/",
"BuildDirectory": "build/"
},
"Profile": {
"UserName": "Sharp0802",
"ProfileImage": "https://avatars.githubusercontent.com/u/64760536?v=4"
},
"Contacts": {
"GitHub": "https://github.com/Sharp0802",
"Email": "sharp0802.business@gmail.com",
"Misc": []
}
}
14 changes: 11 additions & 3 deletions src/BlogMan/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
using System.CommandLine;
using BlogMan.Components;

var root = new RootCommand();
Initializer.InitializeRoot(root);
return await root.InvokeAsync(args);
namespace BlogMan;

public static class Program
{
public static async Task<int> Main(params string[] args)
{
var root = new RootCommand();
Initializer.InitializeRoot(root);
return await root.InvokeAsync(args);
}
}

0 comments on commit b47a65a

Please sign in to comment.