diff options
author | Matt Ward <matt.ward@xamarin.com> | 2015-07-29 23:56:14 +0300 |
---|---|---|
committer | Matt Ward <matt.ward@xamarin.com> | 2015-07-29 23:56:14 +0300 |
commit | 49638a281842d41c96c902543a4cfdc897de8c91 (patch) | |
tree | 5bbb56865c021628e5a5fed1a6f1b8b48eeecef5 /main/src/addins/MonoDevelop.PackageManagement | |
parent | 07953db18ed50cc547f92d7f95dfb6bc43973ff5 (diff) |
[NuGet] Improve unit test.
Test checking for PowerShell messages would always succeed with
change made in 07953db18ed50cc547f92d7f95dfb6bc43973ff5
Diffstat (limited to 'main/src/addins/MonoDevelop.PackageManagement')
-rw-r--r-- | main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UninstallPackageActionTests.cs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UninstallPackageActionTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UninstallPackageActionTests.cs index 7f46a84639..8e3bcfaf66 100644 --- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UninstallPackageActionTests.cs +++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UninstallPackageActionTests.cs @@ -24,8 +24,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using System;
using System.Collections.Generic;
+using System.Linq;
using ICSharpCode.PackageManagement;
using MonoDevelop.PackageManagement.Tests.Helpers;
using NuGet;
@@ -271,16 +271,14 @@ namespace MonoDevelop.PackageManagement.Tests FakePackage package = FakePackage.CreatePackageWithVersion ("Test", "1.0");
action.Package = package;
package.AddFile (@"tools\install.ps1");
- bool messageLogged = false;
+ var messagesLogged = new List<string> ();
packageManagementEvents.PackageOperationMessageLogged += (sender, e) => {
- if (e.Message.Level == MessageLevel.Warning) {
- messageLogged = true;
- }
+ messagesLogged.Add (e.Message.ToString ());
};
action.Execute ();
- Assert.IsFalse (messageLogged);
+ Assert.IsFalse (messagesLogged.Any (message => message.Contains ("PowerShell")));
}
}
}
|