コード例 #1
0
        public void ThenTheRetrievedDataIsAsExpected(string userName, string role)
        {
            // Assert the data for user1.
            var roles = _actual.GetRolesFor(userName).ToArray();

            Assert.IsTrue(roles.Contains(role));
        }
コード例 #2
0
        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'.");
        }