mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 17:23:27 -05:00
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:
@@ -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>()))
|
||||
|
||||
Reference in New Issue
Block a user