Exemple #1
0
        public void CaptainOperation()
        {
            CaptainsService service = new CaptainsService();
            RequestCaptain  captain = new RequestCaptain
            {
                INSERT_USER         = "******",
                UPDATE_USER         = "******",
                CAPTAIN_NAME        = "dexter",
                CAPTAIN_MIDDLE_NAME = null,
                CAPTAIN_SURNAME     = "jason",
                BOAT_ID             = 3,
                IDENTIFICATION_ID   = 19034546316,
                EMAIL        = "*****@*****.**",
                PHONE_NUMBER = "5336668877",
                CAPTAIN_INFO = "xxxxxxxxxxxxxxxyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyzzzzzzzzzzzzzzzzzzzzz",
                Header       = new Header
                {
                    Device         = (int)DeviceEnum.Device.WEB,
                    OperationTypes = (int)OperationType.OperationTypes.ADD,
                    RequestId      = Guid.NewGuid().ToString(),
                    ApiKey         = "U6l1hKzpZDrgfTaKxpQm3A/6raDiroAI7ueTgMNwhQs=",
                    TokenId        = ""
                }
            };

            CaptainOperation cc = new CaptainOperation(captain, service);

            cc.Execute();

            Assert.IsNotNull(cc.response);
            Assert.IsTrue(cc.response.header.IsSuccess == true);
        }
        public async Task <BaseResponseMessage> CaptainService(RequestCaptain request)
        {
            CaptainOperation op = new CaptainOperation(request, this.captainsService);

            op.Execute();

            return(op.response);
        }
        public async Task <BaseResponseMessage> CaptainService([FromBody] JObject json)
        {
            string jsonRequest = json.ToString();

            RequestCaptain request = new RequestCaptain();

            request = JsonConvert.DeserializeObject <RequestCaptain>(jsonRequest);

            return(await this.repository.CaptainService(request));
        }
Exemple #4
0
 public CaptainOperation(RequestCaptain request, CaptainsService service)
 {
     this.request.Header  = new Header();
     this.request         = request;
     this.captainsService = service;
 }
Exemple #5
0
 public CaptainOperation(RequestCaptain request)
 {
     this.request.Header = new Header();
     this.request        = request;
 }