コード例 #1
0
        public async Task When_Passing_Null_Parameter_Then_Exceptions_Are_Thrown()
        {
            // ARRANGE
            InitializeFakeObjects();
            var localAuthenticationParameter = new LocalAuthenticationParameter();

            // ACTS & ASSERTS
            await Assert.ThrowsAsync <ArgumentNullException>(() => _localUserAuthenticationAction.Execute(null, null, null));

            await Assert.ThrowsAsync <ArgumentNullException>(() => _localUserAuthenticationAction.Execute(localAuthenticationParameter, null, null));
        }
コード例 #2
0
        public async Task <LocalOpenIdAuthenticationResult> LocalOpenIdUserAuthentication(LocalAuthenticationParameter localAuthenticationParameter, AuthorizationParameter authorizationParameter, string code)
        {
            if (localAuthenticationParameter == null)
            {
                throw new ArgumentNullException("localAuthenticationParameter");
            }

            if (authorizationParameter == null)
            {
                throw new ArgumentNullException("authorizationParameter");
            }

            return(await _localOpenIdUserAuthenticationAction.Execute(
                       localAuthenticationParameter,
                       authorizationParameter,
                       code));
        }