public void CanRemove_should_throw_exception_if_contributor_not_found() { var command = new RemoveContributor { ContributorId = "1" }; Assert.Throws <DomainObjectNotFoundException>(() => GuardAppContributors.CanRemove(contributors, command)); }
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); }
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)); }
public void CanRemove_should_throw_exception_if_contributor_id_is_null() { var command = new RemoveContributor(); Assert.Throws <ValidationException>(() => GuardAppContributors.CanRemove(contributors, command)); }