Adding tests

This commit is contained in:
2025-05-19 00:03:27 +02:00
parent ec0847e95c
commit 58b7e75e77

View File

@@ -5,12 +5,10 @@ using BasicDotnetTemplate.MainProject.Models.Common;
namespace BasicDotnetTemplate.MainProject.Tests; namespace BasicDotnetTemplate.MainProject.Tests;
[TestClass] [TestClass]
public static class FileUtils_Tests public class FileUtils_Tests
{ {
[TestMethod] [TestMethod]
public static void ConvertFileToObject_NoFilePath() public void ConvertFileToObject_NoFilePath()
{
try
{ {
try try
{ {
@@ -26,17 +24,9 @@ public static class FileUtils_Tests
Assert.Fail($"An exception was thrown: {exception}"); Assert.Fail($"An exception was thrown: {exception}");
} }
} }
catch (Exception ex)
{
Console.WriteLine(ex.InnerException);
Assert.Fail($"An exception was thrown: {ex}");
}
}
[TestMethod] [TestMethod]
public static void ConvertFileToObject_NoFile() public void ConvertFileToObject_NoFile()
{
try
{ {
try try
{ {
@@ -52,12 +42,7 @@ public static class FileUtils_Tests
Assert.Fail($"An exception was thrown: {exception}"); Assert.Fail($"An exception was thrown: {exception}");
} }
} }
catch (Exception ex)
{
Console.WriteLine(ex.InnerException);
Assert.Fail($"An exception was thrown: {ex}");
}
}
} }