コード例 #1
0
ファイル: LoginServiceTest.cs プロジェクト: emrahbasmaz/boat
        public void LoginOperation()
        {
            CustomerService service = new CustomerService();
            string          pass    = "******";

            byte[] bb = Encoding.UTF8.GetBytes(pass);

            RequestPersonalInformation request = new RequestPersonalInformation()
            {
                CUSTOMER_NAME     = "john",
                CUSTOMER_SURNAME  = "cluster",
                CUSTOMER_NUMBER   = 1,
                EMAIL             = "*****@*****.**",
                INSERT_USER       = "******",
                IDENTIFICATION_ID = 79945571838,
                PHONE_NUMBER      = "5357977315",
                UPDATE_USER       = "******",
                GENDER            = Enum.GetName(typeof(Enums.GENDER), 1),
                PASSWORD_HASH     = bb,
                PASSWORD_SALT     = bb,
                Header            = new Header
                {
                    Device         = (int)DeviceEnum.Device.WEB,
                    OperationTypes = (int)OperationType.OperationTypes.ADD,
                    RequestId      = Guid.NewGuid().ToString(),
                    ApiKey         = "U6l1hKzpZDrgfTaKxpQm3A/6raDiroAI7ueTgMNwhQs="
                }
            };

            LoginOperation op = new LoginOperation(request, service);

            op.Execute();

            Assert.IsTrue(op.baseResponseMessage.header.IsSuccess);
        }
コード例 #2
0
        public PersonalInformationOperation(RequestPersonalInformation request, CustomerService service)
        {
            this.request.Header = new Header();
            this.request        = request;

            this.customerService = service;
        }
コード例 #3
0
        public void PersonalInformation()
        {
            AuthRepository  repository = new AuthRepository();
            CustomerService service    = new CustomerService();
            string          pass       = "******";

            byte[] bb = Encoding.UTF8.GetBytes(pass);

            RequestPersonalInformation request = new RequestPersonalInformation()
            {
                CUSTOMER_NAME     = "john",
                CUSTOMER_SURNAME  = "cluster",
                CUSTOMER_NUMBER   = 1,
                EMAIL             = "*****@*****.**",
                INSERT_USER       = "******",
                IDENTIFICATION_ID = 79945571838,
                PHONE_NUMBER      = "5357977315",
                UPDATE_USER       = "******",
                GENDER            = Enum.GetName(typeof(Enums.GENDER), 1),
                PASSWORD_HASH     = bb,
                Header            = new Header
                {
                    Device         = (int)DeviceEnum.Device.WEB,
                    OperationTypes = (int)OperationType.OperationTypes.ADD,
                    RequestId      = Guid.NewGuid().ToString(),
                    ApiKey         = "U6l1hKzpZDrgfTaKxpQm3A/6raDiroAI7ueTgMNwhQs="
                }
            };

            Task <ResponsePersonalInformation> response = repository.Register(request);

            Assert.IsTrue(response.IsCompletedSuccessfully);
        }
コード例 #4
0
        public async Task <ResponsePersonalInformation> Register(RequestPersonalInformation request)
        {
            PersonalInformationOperation op = new PersonalInformationOperation(request, service);

            op.Execute();

            return(op.response);
        }
コード例 #5
0
        public async Task <BaseResponseMessage> Login(RequestPersonalInformation request)
        {
            LoginOperation op = new LoginOperation(request, service);

            op.Execute();

            return(op.baseResponseMessage);
        }
コード例 #6
0
        public Task <ResponsePersonalInformation> CustomerInformationServiceAsync([FromBody] JObject json)
        {
            string jsonRequest = json.ToString();
            RequestPersonalInformation request = new RequestPersonalInformation();

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

            return(this.repository.Register(request));
        }
コード例 #7
0
        public async Task <BaseResponseMessage> LoginService([FromBody] JObject json)
        {
            string jsonRequest = json.ToString();
            RequestPersonalInformation request = new RequestPersonalInformation();

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

            return(await this.repository.Login(request));
        }
コード例 #8
0
        public bool CustomerOperation(RequestPersonalInformation request, out ResponsePersonalInformation response)
        {
            PersonalInformationOperation op = new PersonalInformationOperation(request);

            op.Execute();
            response = op.response;
            if (!op.response.header.IsSuccess)
            {
                return(false);
            }
            return(true);
        }
コード例 #9
0
        public bool LoginOperation(RequestPersonalInformation request, out BaseResponseMessage response)
        {
            LoginOperation op = new LoginOperation(request);

            op.Execute();
            response = op.baseResponseMessage;

            if (!response.header.IsSuccess)
            {
                return(false);
            }

            return(true);
        }
コード例 #10
0
 public LoginOperation(RequestPersonalInformation request, CustomerService customerService) : base(OperationCounter.LoginOperation)
 {
     this.request.Header  = new Header();
     this.request         = request;
     this.customerService = customerService;
 }
コード例 #11
0
 public PersonalInformationOperation(RequestPersonalInformation request)
 {
     this.request.Header = new Header();
     this.request        = request;
 }
コード例 #12
0
ファイル: LoginOperation.cs プロジェクト: emrahbasmaz/boat
 public LoginOperation(RequestPersonalInformation request) : base(OperationCounter.LoginOperation)
 {
     this.request.Header = new Header();
     this.request        = request;
 }