Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(643)

Unified Diff: visual_studio/NativeClientVSAddIn/UnitTests/MockProcessSearcher.cs

Issue 10758009: Native Client Visual Studio Add-in (Closed) Base URL: https://nativeclient-sdk.googlecode.com/svn/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: visual_studio/NativeClientVSAddIn/UnitTests/MockProcessSearcher.cs
diff --git a/visual_studio/NativeClientVSAddIn/UnitTests/MockProcessSearcher.cs b/visual_studio/NativeClientVSAddIn/UnitTests/MockProcessSearcher.cs
new file mode 100644
index 0000000000000000000000000000000000000000..d268321fa3e0b80d8a765bca16610994c0f004ad
--- /dev/null
+++ b/visual_studio/NativeClientVSAddIn/UnitTests/MockProcessSearcher.cs
@@ -0,0 +1,38 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+namespace UnitTests
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Management;
+
+ /// <summary>
+ /// A fake process searcher that allows the list of 'processes' on the system to be faked.
+ /// </summary>
+ public class MockProcessSearcher : NativeClientVSAddIn.ProcessSearcher
+ {
+ /// <summary>
+ /// Constructs the fake process searcher.
+ /// </summary>
+ public MockProcessSearcher()
+ {
+ this.ProcessList = new List<NativeClientVSAddIn.ProcessInfo>();
+ }
+
+ /// <summary>
+ /// Gets or sets the fake list of processes this MockProcessSearcher knows about.
+ /// </summary>
+ public List<NativeClientVSAddIn.ProcessInfo> ProcessList { get; set; }
+
+ /// <summary>
+ /// This method substitutes the fake process list for the list of real system processes.
+ /// </summary>
+ /// <returns>Fake list of processes</returns>
+ protected override List<NativeClientVSAddIn.ProcessInfo> GetSystemProcesses()
+ {
+ return this.ProcessList;
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698