public void Notification_Message_LastExecutionTime()
{
Subscription.Subscribe(Subscriber1, TestRoot, NotificationFrequency.Immediately, "en", TESTSITEPATH, TESTSITEURL);
TestRoot.Security.SetPermission(Subscriber1, true, PermissionType.OpenMinor, ContentRepository.Storage.Security.PermissionValue.Allow);
var content1 = Content.CreateNew("Car", TestRoot, "car_LastExecutionTime");
content1.Save();
IEnumerable<Subscription> subscriptions;
// The time of the operation always will be written into the database after collecting subscriptions.
// The next collecting process uses this time if the NotificationFrequency is Immediately
// This ensures that a message will be generated once one
Event.CreateAndSave("/Root/_NotificationTests", 1, 1, NotificationType.MajorVersionModified, "\\Administrator");
subscriptions = NotificationHandlerAccessor.CollectEventsPerSubscription(NotificationFrequency.Immediately, DateTime.Now).ToArray();
Assert.IsTrue(subscriptions.Count() == 1, "#1");
Event.CreateAndSave("/Root/_NotificationTests", 1, 1, NotificationType.MinorVersionModified, "\\Administrator");
subscriptions = NotificationHandlerAccessor.CollectEventsPerSubscription(NotificationFrequency.Immediately, DateTime.Now).ToArray();
Assert.IsTrue(subscriptions.Count() == 1, "#2");
}