BusinessLogic.Tests.UnitTests.LogicTests.UsersTests.GamingGroupContextSwitcherTests.SwitchGamingGroupContextTests.ItValidatesThatTheUserHasAccessToThisGamingGroup C# (CSharp) Method

ItValidatesThatTheUserHasAccessToThisGamingGroup() private method

private ItValidatesThatTheUserHasAccessToThisGamingGroup ( ) : void
return void
        public void ItValidatesThatTheUserHasAccessToThisGamingGroup()
        {
            int gamingGroupTheUserCantSee = -999;
            string expectedMessage = string.Format(GamingGroupContextSwitcher.EXCEPTION_MESSAGE_NO_ACCESS, currentUser.Id, gamingGroupTheUserCantSee);

            var exception = Assert.Throws<UnauthorizedAccessException>(() => contextSwitcher.SwitchGamingGroupContext(gamingGroupTheUserCantSee, currentUser));

            Assert.That(exception.Message, Is.EqualTo(expectedMessage));
        }