Skip to content

Commit

Permalink
Fixed paths in tests. Try 2
Browse files Browse the repository at this point in the history
  • Loading branch information
skuill committed Aug 20, 2023
1 parent 9d9f5b2 commit 1607ed0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion LyricsScraperNET.TestShared/Utils/Serializer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.Json;

namespace LyricsScraperNET.TestShared.Utils
Expand All @@ -8,7 +11,8 @@ public static class Serializer
{
public static T Deseialize<T>(string path)
{
var jsonString = File.ReadAllText(Path.Combine(Environment.CurrentDirectory, path));
IEnumerable<string> paths = new List<string> { Environment.CurrentDirectory }.Concat(path.Split(new char[] { '\\', '/' }));
var jsonString = File.ReadAllText(Path.Combine(paths.ToArray()));
return JsonSerializer.Deserialize<T>(jsonString);
}
}
Expand Down

0 comments on commit 1607ed0

Please sign in to comment.