public void ThenTheRetrievedDataIsAsExpected(string userName, string role) { // Assert the data for user1. var roles = _actual.GetRolesFor(userName).ToArray(); Assert.IsTrue(roles.Contains(role)); }
public void ThenExpectedExceptionsAreThrown() { Assert.ThrowsException <ArgumentException>( () => _sut.HasRole("idontexist", string.Empty), "User 'idontexist' not found."); Assert.ThrowsException <ArgumentException>( () => _sut.GetRolesFor("user3"), "No roles found for user 'user3'."); }