added some tests around uploading assets

This commit is contained in:
Brendan Forster
2014-05-05 08:33:50 +08:00
parent df0f7ebda9
commit ef22c34227
4 changed files with 71 additions and 0 deletions
+14
View File
@@ -1,6 +1,8 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Net.Http.Headers;
using System.Reflection;
namespace Octokit.Tests.Integration
{
@@ -57,5 +59,17 @@ namespace Octokit.Tests.Integration
{
return string.Concat(name, "-", DateTime.UtcNow.ToString("yyyyMMddhhmmssfff"));
}
public static Stream LoadFixture(string fileName)
{
var key = "Octokit.Tests.Integration.fixtures." + fileName;
var stream = typeof(Helper).Assembly.GetManifestResourceStream(key);
if (stream == null)
{
throw new InvalidOperationException(
"The file '" + fileName + "' was not found as an embedded resource in the assembly. Failing the test...");
}
return stream;
}
}
}