Moving xmlrpc method to upload files into media module. Updating some localized string tests.

--HG--
extra : convert_revision : svn%3A5ff7c347-ad56-4c35-b696-ccb81de16e03/trunk%4040921
This commit is contained in:
loudej
2009-11-17 03:19:46 +00:00
parent e414c47854
commit 0cc64ebe1c
9 changed files with 105 additions and 43 deletions

View File

@@ -1,4 +1,5 @@
using NUnit.Framework;
using Orchard.Localization;
using Orchard.UI.Notify;
namespace Orchard.Tests.UI.Notify {
@@ -12,13 +13,12 @@ namespace Orchard.Tests.UI.Notify {
notifier.Information("More Info");
notifier.Error("Boom");
Localizer T = NullLocalizer.Instance;
Assert.That(notifier.List(), Has.Count.EqualTo(3));
foreach (var notifyEntries in notifier.List()) {
Assert.That(new[] {notifyEntries.Message.ToString()}, Is.SubsetOf(new[]
{
"Hello world", "More Info", "Boom"
}));
}
Assert.That(notifier.List(), Has.Some.Property("Message").EqualTo(T("Hello world")));
Assert.That(notifier.List(), Has.Some.Property("Message").EqualTo(T("More Info")));
Assert.That(notifier.List(), Has.Some.Property("Message").EqualTo(T("Boom")));
}
}
}

View File

@@ -2,6 +2,7 @@
using System.Web.Routing;
using Moq;
using NUnit.Framework;
using Orchard.Localization;
using Orchard.Mvc.ViewModels;
using Orchard.Tests.Stubs;
using Orchard.UI.Notify;
@@ -73,14 +74,12 @@ namespace Orchard.Tests.UI.Notify {
filter.OnActionExecuted(context);
filter.OnResultExecuting(new ResultExecutingContext(context, context.Result));
var T = NullLocalizer.Instance;
Assert.That(model.Messages, Is.Not.Null);
Assert.That(model.Messages, Has.Count.EqualTo(2));
foreach (var notifyEntries in model.Messages) {
Assert.That(new[] { notifyEntries.Message.ToString() }, Is.SubsetOf(new[]
{
"dont-destroy", "Working"
}));
}
Assert.That(model.Messages, Has.Some.Property("Message").EqualTo(T("dont-destroy")));
Assert.That(model.Messages, Has.Some.Property("Message").EqualTo(T("Working")));
}
}
}