示例#1
0
        public void ShouldCallCloseOnViewWhenSetObjectIsCalled()
        {
            var newComment = new Comment
            {
                MarkIn  = 200,
                MarkOut = 250,
                Text    = "Text"
            };

            var presentationModel = this.CreatePresentationModel();

            Assert.IsFalse(this.view.CloseCalled);

            presentationModel.SetElement(newComment, CommentMode.Timeline);

            Assert.IsTrue(this.view.CloseCalled);
        }
示例#2
0
        public void ShouldRaiseTimelineBarElementEventWhenSetObjectIsCalled()
        {
            var newComment = new Comment
            {
                MarkIn  = 200,
                MarkOut = 250,
                Text    = "Text"
            };

            var timelineBarElementUpdatedEventRaised = false;

            var presentationModel = this.CreatePresentationModel();

            presentationModel.TimelineBarElementUpdated += (sender, e) => timelineBarElementUpdatedEventRaised = true;

            presentationModel.SetElement(newComment, CommentMode.Timeline);

            Assert.IsTrue(timelineBarElementUpdatedEventRaised);
        }
        public void ShouldCallToSetCurrentTimeWhenMoveToEndCommandIsExecutedAndPlayerModeIsComment()
        {
            var     presenter = this.CreatePresenter();
            Comment comment   = new Comment(Guid.NewGuid())
            {
                CommentType = CommentType.Timeline,
                MarkIn      = 100,
                MarkOut     = 200,
            };

            // To set the currentPlayingComment variable.
            this.playCommentEvent.Publish(comment);
            presenter.PlayerMode           = PlayerMode.Comment;
            this.view.SetCurrentTimeCalled = false;

            presenter.MoveToEndCommand.Execute(null);

            Assert.IsTrue(this.view.SetCurrentTimeCalled);
            Assert.IsTrue(this.view.SetCurrentTimeArgument.TotalSeconds == comment.MarkOut);
        }
示例#4
0
        public void ShouldReplaceTheCurrentValuesWhenCallingToSetObject()
        {
            var newComment = new Comment
            {
                MarkIn  = 200,
                MarkOut = 250,
                Text    = "Text"
            };

            var presentationModel = this.CreatePresentationModel();

            var oldComment = this.sequenceRegistry.CurrentSequence.CommentElements[0];

            this.sequenceRegistry.CurrentSequence.AddComment(newComment);

            presentationModel.SetElement(newComment, CommentMode.Timeline);

            Assert.AreEqual(newComment.MarkIn, presentationModel.MarkIn);
            Assert.AreEqual(newComment.MarkOut, presentationModel.MarkOut);
            Assert.AreEqual(newComment.Text, presentationModel.Text);
        }
        public void ShouldReplaceTheCurrentCommentWhenCallingToSetObject()
        {
            var newComment = new Comment
            {
                MarkIn  = 200,
                MarkOut = 250,
                Text    = "Text"
            };

            var presentationModel = this.CreatePresentationModel();

            var oldComment = this.timelineModel.CommentElements[0];

            this.timelineModel.AddComment(newComment);

            presentationModel.SetElement(newComment);

            Assert.AreEqual(1, this.timelineModel.CommentElements.Count);
            Assert.AreNotEqual(oldComment, this.timelineModel.CommentElements[0]);
            Assert.AreEqual(newComment, this.timelineModel.CommentElements[0]);
        }
示例#6
0
 public override void Publish(RCE.Infrastructure.Models.Comment payload)
 {
     this.PublishCalled          = true;
     this.PublishArgumentPayload = payload;
 }