File contents are gzip'ed when they come back from TFS.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// Generated by git-tfs-test-builder
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Text;
|
||||
using Sep.Git.Tfs.Core.TfsInterop;
|
||||
using Sep.Git.Tfs.Test.Integration;
|
||||
@@ -117,20 +118,21 @@ namespace Sep.Git.Tfs.Test.Fixtures
|
||||
;
|
||||
}
|
||||
|
||||
private static string Read(string itemContentHash)
|
||||
private static byte[] Read(string itemContentHash)
|
||||
{
|
||||
if (itemContentHash == null)
|
||||
return string.Empty;
|
||||
return new byte[0];
|
||||
|
||||
using (var stream = typeof(vtccds).Assembly.GetManifestResourceStream("Sep.Git.Tfs.Test.Fixtures.vtccds." + itemContentHash))
|
||||
{
|
||||
if (stream == null)
|
||||
throw new Exception("Fail: Can not find test file:" + itemContentHash);
|
||||
using (var reader = new BinaryReader(stream))
|
||||
|
||||
using (var gzipReader = new GZipStream(stream, CompressionMode.Decompress))
|
||||
{
|
||||
//ToDo: How to convert bytes to the expected string!?!
|
||||
var content = reader.ReadBytes((int)stream.Length);
|
||||
return Encoding.UTF8.GetString(content);
|
||||
var buffer = new MemoryStream();
|
||||
gzipReader.CopyTo(buffer);
|
||||
return buffer.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user