public async Task CanBeExecutedForPlaceholders()
            {
                var session        = CreateSession();
                var thread         = CreateThread();
                var currentUser    = Substitute.For <IActorViewModel>();
                var commentService = Substitute.For <ICommentService>();
                var target         = new PullRequestReviewCommentViewModel(commentService);

                await target.InitializeAsPlaceholderAsync(session, thread, false);

                Assert.That(target.BeginEdit.CanExecute(new object()), Is.True);
            }
Ejemplo n.º 2
0
            public async Task CannotBeExecutedForPlaceholders()
            {
                var session             = CreateSession();
                var thread              = CreateThread();
                var currentUser         = Substitute.For <IActorViewModel>();
                var commentService      = Substitute.For <ICommentService>();
                var autoCompleteAdvisor = Substitute.For <IAutoCompleteAdvisor>();
                var target              = new PullRequestReviewCommentViewModel(commentService, autoCompleteAdvisor);

                await target.InitializeAsPlaceholderAsync(session, thread, false, false);

                Assert.That(target.Delete.CanExecute(new object()), Is.False);
            }