예제 #1
0
        public void CanRemove_should_throw_exception_if_contributor_not_found()
        {
            var command = new RemoveContributor {
                ContributorId = "1"
            };

            Assert.Throws <DomainObjectNotFoundException>(() => GuardAppContributors.CanRemove(contributors, command));
        }
예제 #2
0
        public void CanRemove_should_not_throw_exception_if_contributor_not_only_owner()
        {
            var command = new RemoveContributor {
                ContributorId = "1"
            };

            contributors.Assign("1", AppContributorPermission.Owner);
            contributors.Assign("2", AppContributorPermission.Owner);

            GuardAppContributors.CanRemove(contributors, command);
        }
예제 #3
0
        public void CanRemove_should_throw_exception_if_contributor_is_only_owner()
        {
            var command = new RemoveContributor {
                ContributorId = "1"
            };

            contributors.Assign("1", AppContributorPermission.Owner);
            contributors.Assign("2", AppContributorPermission.Editor);

            Assert.Throws <ValidationException>(() => GuardAppContributors.CanRemove(contributors, command));
        }
예제 #4
0
        public void CanRemove_should_throw_exception_if_contributor_id_is_null()
        {
            var command = new RemoveContributor();

            Assert.Throws <ValidationException>(() => GuardAppContributors.CanRemove(contributors, command));
        }