diff --git a/FluentResultsTest/FluentResultsTest.csproj b/FluentResultsTest/FluentResultsTest.csproj new file mode 100644 index 0000000..3c27f3a --- /dev/null +++ b/FluentResultsTest/FluentResultsTest.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + enable + enable + 12 + + + + + + + diff --git a/FluentResultsTest/Program.cs b/FluentResultsTest/Program.cs new file mode 100644 index 0000000..42f449c --- /dev/null +++ b/FluentResultsTest/Program.cs @@ -0,0 +1,22 @@ +// See https://aka.ms/new-console-template for more information + +using FluentResults; + +var action = new Action(() => throw new Exception("test")); +var result = Result.Try(action); + +var worker = new Worker(); +var result2 = Result.Try(worker.DoWork); + +result.WithErrors(result2.Errors) + .WithError($"error {new List {1, 2, 3}}"); + +Console.WriteLine(result); + +public class Worker +{ + public void DoWork() + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/Test.sln b/Test.sln index a90dffa..c8a0377 100644 --- a/Test.sln +++ b/Test.sln @@ -6,6 +6,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DryIocTest", "DryIocTest\Dr EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZxingQrTest", "ZxingQrTest\ZxingQrTest.csproj", "{D2967CE3-CE36-4BEA-967C-5156A1081C13}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FluentResultsTest", "FluentResultsTest\FluentResultsTest.csproj", "{90C3FF9F-295D-40C3-98CC-72BECD4453EC}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -24,5 +26,9 @@ Global {D2967CE3-CE36-4BEA-967C-5156A1081C13}.Debug|Any CPU.Build.0 = Debug|Any CPU {D2967CE3-CE36-4BEA-967C-5156A1081C13}.Release|Any CPU.ActiveCfg = Release|Any CPU {D2967CE3-CE36-4BEA-967C-5156A1081C13}.Release|Any CPU.Build.0 = Release|Any CPU + {90C3FF9F-295D-40C3-98CC-72BECD4453EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {90C3FF9F-295D-40C3-98CC-72BECD4453EC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {90C3FF9F-295D-40C3-98CC-72BECD4453EC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {90C3FF9F-295D-40C3-98CC-72BECD4453EC}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal