public void Localize_will_localize_DateTime_passed_as_argument()
        {
            _resourceManagerMock.Setup(x => x.GetString("foo", CultureInfo.InvariantCulture, null))
            .Returns("{0}").AtMostOnce().Verifiable();
            var date     = DateTime.Parse("2010/8/13");
            var resource = new DekiResource("foo", date);

            Assert.AreEqual(date.ToString(CultureInfo.InvariantCulture), _resources.Localize(resource));
            _resourceManagerMock.VerifyAll();
        }
Exemple #2
0
 public void Localize_will_localize_resources_passed_as_arguments() {
     _resourceManagerMock.Setup(x => x.GetString("foo", CultureInfo.InvariantCulture, null))
         .Returns("foo").AtMostOnce().Verifiable();
     _resourceManagerMock.Setup(x => x.GetString("bar", CultureInfo.InvariantCulture, null))
         .Returns("--{0}--").AtMostOnce().Verifiable();
     var r1 = new DekiResource("foo");
     var r2 = new DekiResource("bar", r1);
     Assert.AreEqual("--foo--", _resources.Localize(r2));
     _resourceManagerMock.VerifyAll();
 }
        public void Localize_will_localize_resources_passed_as_arguments()
        {
            _resourceManagerMock.Setup(x => x.GetString("foo", CultureInfo.InvariantCulture, null))
            .Returns("foo").AtMostOnce().Verifiable();
            _resourceManagerMock.Setup(x => x.GetString("bar", CultureInfo.InvariantCulture, null))
            .Returns("--{0}--").AtMostOnce().Verifiable();
            var r1 = new DekiResource("foo");
            var r2 = new DekiResource("bar", r1);

            Assert.AreEqual("--foo--", _resources.Localize(r2));
            _resourceManagerMock.VerifyAll();
        }
Exemple #4
0
 //--- Constructors ---
 protected ResourcedMindTouchException(DekiResource resource) {
     Resource = resource;
 }
        public static void AddMovePageRecentChange(DateTime timestamp, PageBE oldTitle, Title newTitle, UserBE user, DekiResource comment, bool minorChange, uint transactionId)
        {
            var resources = DekiContext.Current.Resources;

            DbUtils.CurrentSession.RecentChanges_Insert(timestamp, oldTitle, user, resources.Localize(comment), 0, RC.MOVE, (uint)newTitle.Namespace, newTitle.AsUnprefixedDbPath(), minorChange, transactionId);
        }
Exemple #6
0
 //--- Constructors ---
 public ExternalServiceResponseException(DekiResource message, DreamMessage externalServiceResponse)
     : base(message) {
     ExternalServiceResponse = externalServiceResponse;
 }
Exemple #7
0
 protected MindTouchNotFoundException(DekiResource resource) : base(resource) {
     Status = DreamStatus.NotFound;
 }
Exemple #8
0
 public SiteConflictException(DekiResource resource) : base(resource) { }
Exemple #9
0
 protected MindTouchFatalCallException(DekiResource resource) : base(resource) {
     Status = DreamStatus.InternalError;
 }
Exemple #10
0
 public PermissionsForbiddenException(DekiResource error) : base(error) { }
Exemple #11
0
 public static void AddMovePageRecentChange(DateTime timestamp, PageBE oldTitle, Title newTitle, UserBE user, DekiResource comment, bool minorChange, uint transactionId) {
     var resources = DekiContext.Current.Resources;
     DbUtils.CurrentSession.RecentChanges_Insert(timestamp, oldTitle, user, resources.Localize(comment), 0, RC.MOVE, (uint)newTitle.Namespace, newTitle.AsUnprefixedDbPath(), minorChange, transactionId);
 }
Exemple #12
0
 public static void AddRestorePageRecentChange(DateTime timestamp, PageBE page, UserBE user, DekiResource comment, bool minorChange, uint transactionId) {
     var resources = DekiContext.Current.Resources;
     DbUtils.CurrentSession.RecentChanges_Insert(timestamp, page, user, resources.Localize(comment), 0, RC.PAGERESTORED, 0, string.Empty, minorChange, transactionId);
 }
Exemple #13
0
 public static void AddUserCreatedRecentChange(DateTime timestamp, PageBE title, UserBE user, DekiResource comment) {
     var resources = DekiContext.Current.Resources;
     DbUtils.CurrentSession.RecentChanges_Insert(timestamp, title, user, resources.Localize(comment), 0, RC.USER_CREATED, 0, String.Empty, false, 0);
 }
Exemple #14
0
 public static void AddFileRecentChange(DateTime timestamp, PageBE title, UserBE user, DekiResource comment, uint transactionId) {
     var resources = DekiContext.Current.Resources;
     DbUtils.CurrentSession.RecentChanges_Insert(timestamp, title, user, resources.Localize(comment), 0, RC.FILE, 0, String.Empty, false, transactionId);
 }
        private static void AddCommentRecentChange(DateTime timestamp, PageBE page, UserBE user, DekiResource summary, CommentBE comment, RC rcType)
        {
            var resources = DekiContext.Current.Resources;

            //TODO MaxM: Consider truncating summary
            DbUtils.CurrentSession.RecentChanges_Insert(timestamp, page, user, resources.Localize(summary), 0, rcType, 0, string.Empty, false, 0);
        }
 public static void AddCommentUpdateRecentChange(DateTime timestamp, PageBE page, UserBE user, DekiResource summary, CommentBE comment)
 {
     AddCommentRecentChange(timestamp, page, user, summary, comment, RC.COMMENT_UPDATE);
 }
        public static void AddRestorePageRecentChange(DateTime timestamp, PageBE page, UserBE user, DekiResource comment, bool minorChange, uint transactionId)
        {
            var resources = DekiContext.Current.Resources;

            DbUtils.CurrentSession.RecentChanges_Insert(timestamp, page, user, resources.Localize(comment), 0, RC.PAGERESTORED, 0, string.Empty, minorChange, transactionId);
        }
Exemple #18
0
 protected MindTouchInvalidCallException(DekiResource resource) : base(resource) { }
Exemple #19
0
 public static void AddCommentUpdateRecentChange(DateTime timestamp, PageBE page, UserBE user, DekiResource summary, CommentBE comment) {
     AddCommentRecentChange(timestamp, page, user, summary, comment, RC.COMMENT_UPDATE);
 }
Exemple #20
0
 protected MindTouchArgumentException(DekiResource resource) : base(resource) { }
Exemple #21
0
        private static void AddCommentRecentChange(DateTime timestamp, PageBE page, UserBE user, DekiResource summary, CommentBE comment, RC rcType) {
            var resources = DekiContext.Current.Resources;

            //TODO MaxM: Consider truncating summary
            DbUtils.CurrentSession.RecentChanges_Insert(timestamp, page, user, resources.Localize(summary), 0, rcType, 0, string.Empty, false, 0);
        }
Exemple #22
0
 protected MindTouchConflictException(DekiResource resource) : base(resource) {
     Status = DreamStatus.Conflict;
 }
        public static void AddUserCreatedRecentChange(DateTime timestamp, PageBE title, UserBE user, DekiResource comment)
        {
            var resources = DekiContext.Current.Resources;

            DbUtils.CurrentSession.RecentChanges_Insert(timestamp, title, user, resources.Localize(comment), 0, RC.USER_CREATED, 0, String.Empty, false, 0);
        }
Exemple #24
0
 public PermissionsDeniedException(string authRealm, DekiResource error)
     : base(authRealm, DekiResources.OPERATION_DENIED_FOR_ANONYMOUS(error)) {
 }
Exemple #25
0
 public void Localize_will_localize_DateTime_passed_as_argument() {
     _resourceManagerMock.Setup(x => x.GetString("foo", CultureInfo.InvariantCulture, null))
         .Returns("{0}").AtMostOnce().Verifiable();
     var date = DateTime.Parse("2010/8/13");
     var resource = new DekiResource("foo", date);
     Assert.AreEqual(date.ToString(CultureInfo.InvariantCulture), _resources.Localize(resource));
     _resourceManagerMock.VerifyAll();
 }
Exemple #26
0
        protected MindTouchForbiddenException(DekiResource resource) : base(resource) {
            Status = DreamStatus.Forbidden;

        }
Exemple #27
0
 protected MindTouchNotImplementedException(DekiResource resource) : base(resource) {
     Status = DreamStatus.NotImplemented;
 }
Exemple #28
0
 //--- Constructors ---
 protected MindTouchAccessDeniedException(string authRealm, DekiResource resource) : base(resource) {
     AuthRealm = authRealm;
     Status = DreamStatus.Unauthorized;
 }
        public static void AddFileRecentChange(DateTime timestamp, PageBE title, UserBE user, DekiResource comment, uint transactionId)
        {
            var resources = DekiContext.Current.Resources;

            DbUtils.CurrentSession.RecentChanges_Insert(timestamp, title, user, resources.Localize(comment), 0, RC.FILE, 0, String.Empty, false, transactionId);
        }