diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..56fdcb8 Binary files /dev/null and b/.DS_Store differ diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index eb2706c..f914297 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -16,5 +16,10 @@ jobs: dotnet-version: '7.0.x' - name: "🏗️ Build" run: dotnet build + - name: "🗃️ Setup file" + # Add files into /Tests/bin/Debug/net7.0 and create thisfileexist.txt + run: | + mkdir -p Tests/bin/Debug/net7.0 + echo "incredible file" > thisfileexist.txt - name: "✅ Test" run: dotnet test \ No newline at end of file diff --git a/Tests/.DS_Store b/Tests/.DS_Store new file mode 100644 index 0000000..42451df Binary files /dev/null and b/Tests/.DS_Store differ diff --git a/Tests/Stream/StreamTest.cs b/Tests/Stream/StreamTest.cs index 0139eea..89f7157 100644 --- a/Tests/Stream/StreamTest.cs +++ b/Tests/Stream/StreamTest.cs @@ -2,5 +2,12 @@ namespace Tests.Stream; public class StreamTest { - + [Theory] + [InlineData("thisfileexist.txt", true)] + [InlineData("thisfiledontexist.txt", false)] + + public void ExistFileTest(string filePath, bool expected) + { + Assert.Equal(expected, global::Stream.Stream.ExistFile(filePath)); + } } \ No newline at end of file diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 9b7e8f8..b5eb8f8 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -24,6 +24,7 @@ <ItemGroup> <ProjectReference Include="..\Iteration\Iteration.csproj" /> + <ProjectReference Include="..\Stream\Stream.csproj" /> </ItemGroup> </Project>