At the beginning of Shakespeare's Measure for Measure, Duke Vincentio of Vienna pretends to leave the town but actually remains, disguised as a friar. Angelo, the deputy who he leaves in charge of the city, does not expect to be given this power and does not realise that the Duke is testing him.
Angelo has a reputation as "a man of stricture and firm abstinence" and hence is a good choice to enforce laws against immorality. Nevertheless, Angelo himself is capable of beingh tempted and he succumbs to the evil side of his own nature when he offers to spare Claudio's life in exchange for the favours of Isabella.
The best summary of his character is probably that given by the Duke:
Lord Angelo is precise,
Stands at a guard with envy, scarce confesses
That his blood flows, or that his appetite
Is more to bread than tone. Hence shall we see
If power change purpose, what our seemers be.
As a result of Angelo's behaviour, the Duke comes to realise that that human nature is weak and corruptable, and accepts this to some extent. He becomes aware that
leadership requires that a person be fair and not punish people for perceived faults when these are shared by the ruler.