Skip to content

Commit

Permalink
Fix #365 (#366)
Browse files Browse the repository at this point in the history
* Fix #365

* Fixing the unit tests.

Co-authored-by: James O'Neill <[email protected]>
Co-authored-by: Donovan Brown <[email protected]>
  • Loading branch information
3 people authored Oct 15, 2020
1 parent 7daec7c commit f95ce17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Source/Classes/Cache/QueryCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ public static void Update(IEnumerable<string> 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<string>();
.Invoke<string>(queries);
}
}

Expand Down
3 changes: 3 additions & 0 deletions Tests/library/Cache/QueryCacheTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>(this._queries).Returns(this._queryNames);
ps.Invoke<string>().Returns(this._defaultProject, this._queryNames);
QueryCache.Cache.Shell = ps;

Expand All @@ -62,6 +63,8 @@ public void QueryCache_GetCurrent()
var expected = 2;
var ps = BaseTests.PrepPowerShell();
ps.Invoke().Returns(this._queries);
ps.Invoke<string>(this._queries).Returns(this._queryNames);

ps.Invoke<string>().Returns(this._defaultProject, this._queryNames);
QueryCache.Invalidate();
QueryCache.Cache.Shell = ps;
Expand Down

0 comments on commit f95ce17

Please sign in to comment.