Skip to content

Commit f95ce17

Browse files
jhoneillJames O'NeillDarqueWarrior
authored
Fix #365 (#366)
* Fix #365 * Fixing the unit tests. Co-authored-by: James O'Neill <P10506111@capita.co.uk> Co-authored-by: Donovan Brown <dbrown@microsoft.com>
1 parent 7daec7c commit f95ce17

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Source/Classes/Cache/QueryCache.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ public static void Update(IEnumerable<string> list)
3636
}
3737

3838
// This will return just the names
39-
list = Cache.Shell.AddArgument(queries)
40-
.AddCommand("Select-Object")
39+
list = Cache.Shell.AddCommand("Select-Object")
4140
.AddParameter("ExpandProperty", "Name")
4241
.AddCommand("Sort-Object")
43-
.Invoke<string>();
42+
.Invoke<string>(queries);
4443
}
4544
}
4645

Tests/library/Cache/QueryCacheTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public void QueryCache_Update_With_Null_List()
4545
var expected = 2;
4646
var ps = BaseTests.PrepPowerShell();
4747
ps.Invoke().Returns(this._queries);
48+
ps.Invoke<string>(this._queries).Returns(this._queryNames);
4849
ps.Invoke<string>().Returns(this._defaultProject, this._queryNames);
4950
QueryCache.Cache.Shell = ps;
5051

@@ -62,6 +63,8 @@ public void QueryCache_GetCurrent()
6263
var expected = 2;
6364
var ps = BaseTests.PrepPowerShell();
6465
ps.Invoke().Returns(this._queries);
66+
ps.Invoke<string>(this._queries).Returns(this._queryNames);
67+
6568
ps.Invoke<string>().Returns(this._defaultProject, this._queryNames);
6669
QueryCache.Invalidate();
6770
QueryCache.Cache.Shell = ps;

0 commit comments

Comments
 (0)