mirror of
https://github.com/bitwarden/server.git
synced 2024-11-29 13:25:17 +01:00
b2af73f00f
* Add StripeFacade and StripeEventService * Add StripeEventServiceTests * Handle customer.updated event in StripeController
23 lines
648 B
C#
23 lines
648 B
C#
using System.Reflection;
|
|
|
|
namespace Bit.Billing.Test.Utilities;
|
|
|
|
public static class EmbeddedResourceReader
|
|
{
|
|
public static async Task<string> ReadAsync(string resourceType, string fileName)
|
|
{
|
|
var assembly = Assembly.GetExecutingAssembly();
|
|
|
|
await using var stream = assembly.GetManifestResourceStream($"Bit.Billing.Test.Resources.{resourceType}.{fileName}");
|
|
|
|
if (stream == null)
|
|
{
|
|
throw new Exception($"Failed to retrieve manifest resource stream for file: {fileName}.");
|
|
}
|
|
|
|
using var reader = new StreamReader(stream);
|
|
|
|
return await reader.ReadToEndAsync();
|
|
}
|
|
}
|