Feat/result streaming - Fix for issue #746 in toolsservice and issue Microsoft/azuredatastudio#3348 (#753)

* fix for issues 746 & azuredatastudio issue 3348

* test coverage improvement for results streaming

* addressed minor review comments

* adding generated file test/CodeCoverage/package-lock.json to workaround code coverage issue.
This commit is contained in:
Arvind Ranasaria
2018-12-04 20:49:05 -08:00
committed by GitHub
parent a1946edca3
commit e4808c12aa
6 changed files with 3996 additions and 88 deletions

View File

@@ -10,19 +10,19 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.Common
public class MemoryFileSystem
{
public static IFileStreamFactory GetFileStreamFactory()
public static IFileStreamFactory GetFileStreamFactory(int sizeFactor=1)
{
return GetFileStreamFactory(new ConcurrentDictionary<string, byte[]>());
return GetFileStreamFactory(new ConcurrentDictionary<string, byte[]>(), sizeFactor);
}
public static IFileStreamFactory GetFileStreamFactory(ConcurrentDictionary<string, byte[]> storage)
public static IFileStreamFactory GetFileStreamFactory(ConcurrentDictionary<string, byte[]> storage, int sizeFactor=1)
{
Mock<IFileStreamFactory> mock = new Mock<IFileStreamFactory>();
mock.Setup(fsf => fsf.CreateFile())
.Returns(() =>
{
string fileName = Guid.NewGuid().ToString();
storage.TryAdd(fileName, new byte[8192]);
storage.TryAdd(fileName, new byte[8192 * sizeFactor]);
return fileName;
});
mock.Setup(fsf => fsf.GetReader(It.IsAny<string>()))