diff --git a/Source/Classes/Cache/QueryCache.cs b/Source/Classes/Cache/QueryCache.cs index 097baa414..5d77cce78 100644 --- a/Source/Classes/Cache/QueryCache.cs +++ b/Source/Classes/Cache/QueryCache.cs @@ -36,11 +36,10 @@ public static void Update(IEnumerable list) } // This will return just the names - list = Cache.Shell.AddArgument(queries) - .AddCommand("Select-Object") + list = Cache.Shell.AddCommand("Select-Object") .AddParameter("ExpandProperty", "Name") .AddCommand("Sort-Object") - .Invoke(); + .Invoke(queries); } } diff --git a/Tests/library/Cache/QueryCacheTests.cs b/Tests/library/Cache/QueryCacheTests.cs index a51778c39..5ae91dc29 100644 --- a/Tests/library/Cache/QueryCacheTests.cs +++ b/Tests/library/Cache/QueryCacheTests.cs @@ -45,6 +45,7 @@ public void QueryCache_Update_With_Null_List() var expected = 2; var ps = BaseTests.PrepPowerShell(); ps.Invoke().Returns(this._queries); + ps.Invoke(this._queries).Returns(this._queryNames); ps.Invoke().Returns(this._defaultProject, this._queryNames); QueryCache.Cache.Shell = ps; @@ -62,6 +63,8 @@ public void QueryCache_GetCurrent() var expected = 2; var ps = BaseTests.PrepPowerShell(); ps.Invoke().Returns(this._queries); + ps.Invoke(this._queries).Returns(this._queryNames); + ps.Invoke().Returns(this._defaultProject, this._queryNames); QueryCache.Invalidate(); QueryCache.Cache.Shell = ps;