コード例 #1
0
        public void HandleIncomingRequestCallback(NDIDCallbackRequestModel model)
        {
            // check that user exist
            NDIDUserModel user = _db.FindUser(model.Namespace, model.Identifier);

            if (user == null)
            {
                throw new ApplicationException();
            }
            _db.SaveUserRequest(model.Namespace, model.Identifier, model.RequestId, model);
        }
コード例 #2
0
        public void SaveAndGetUserRequest()
        {
            string namespaces = "cid";
            string identifier = "1234";
            NDIDCallbackRequestModel request = new NDIDCallbackRequestModel();

            request.RequestId      = "8707fa402ae174737a5a6cefa7e8d47b836f40fdae7f2b53297ceecda27f3b7c";
            request.RequestMsg     = "dummy Request Message";
            request.RequestMsgHash = "wl4+u6caNoCDb5nr2JPuYGmeIGZjRECCQAicomlJ38E=";
            request.Namespace      = namespaces;
            request.Identifier     = identifier;
            _db.SaveUserRequest(namespaces, identifier, request.RequestId, request);
            NDIDCallbackRequestModel actual_request = _db.GetUserRequest(namespaces, identifier, request.RequestId);

            actual_request.Should().BeEquivalentTo <NDIDCallbackRequestModel>(request);
        }