// Copyright (c) 2008, NTT DATA Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using System.Collections.Generic;
using System.Text;
using TERASOLUNA.Fw.Client.Communication;
using System.Data;
using TERASOLUNA.Fw.Common;
using TERASOLUNA.Fw.Common.Validation;

namespace TERASOLUNA.Fw.ClientUT.BLogic.MultipartUploadBLogicData
{
    public class MultipartUploadBLogic_MultipartUploadCommunicatorStub05<TResult> : MultipartUploadCommunicator<TResult> where TResult : DataSet, new()
    {
        /// <summary>
        /// Communicate メソッドが実行された場合、引数 paramData を保持するフィールド。
        /// </summary>
        public IList<MultipartElement> _paramData = null;

        /// <summary>
        /// Communicate メソッドが実行された場合、引数 requestHeaders を保持するフィールド。
        /// </summary>
        public IDictionary<string, string> _requestHeaders = null;

        /// <summary>
        /// Communicate メソッドが実行された場合、戻り値 ResultData に設定するインスタンス。
        /// </summary>
        public TResult _result = new TResult();

        /// <summary>
        /// <see cref="ConverterFactory"/> クラスの新しいインスタンスを初期化します。
        /// </summary>
        /// <remarks>
        /// デフォルトコンストラクタです。
        /// </remarks>
        public MultipartUploadBLogic_MultipartUploadCommunicatorStub05()
        {
        }

        /// <summary>
        /// 必ず ErrorType "serverValidateException" の ServerException をスローする。
        /// </summary>
        /// <param name="paramData"></param>
        /// <param name="requestHeaders"></param>
        /// <returns></returns>
        public override CommunicationResult Communicate(IList<MultipartElement> paramData, IDictionary<string, string> requestHeaders)
        {
            _paramData = paramData;
            _requestHeaders = requestHeaders;

            throw new CommunicationException("MultipartUploadException");
        }
    }
}
