-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Burgyn/tests/addembdebedresources
Add resources in tests as embeddedresources
- Loading branch information
Showing
5 changed files
with
54 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.IO; | ||
using System.Reflection; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace MMLib.SwaggerForOcelot.Tests | ||
{ | ||
/// <summary> | ||
/// Assembly helper class. | ||
/// </summary> | ||
public static class AssemblyHelper | ||
{ | ||
private const string RootNamespaceResources = "MMLib.SwaggerForOcelot.Tests.Resources"; | ||
|
||
/// <summary> | ||
/// Gets the string from resource file asynchronous. | ||
/// </summary> | ||
/// <param name="resourceFile">The resource file name.</param> | ||
public static async Task<string> GetStringFromResourceFileAsync(string resourceFile) | ||
{ | ||
var assembly = Assembly.GetExecutingAssembly(); | ||
var resourceStream = assembly.GetManifestResourceStream($"{RootNamespaceResources}.{resourceFile}"); | ||
using (var reader = new StreamReader(resourceStream, Encoding.UTF8)) | ||
{ | ||
return await reader.ReadToEndAsync(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 0 additions & 119 deletions
119
tests/MMLib.SwaggerForOcelot.Tests/Properties/Resources.Designer.cs
This file was deleted.
Oops, something went wrong.
127 changes: 0 additions & 127 deletions
127
tests/MMLib.SwaggerForOcelot.Tests/Properties/Resources.resx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters