/// <summary>
        ///  ユーザを新規作成します<br />
        /// </summary>
        ///
        /// <returns>IEnumerator</returns>
        /// <param name="callback">コールバックハンドラ</param>
        /// <param name="request">リクエストパラメータ</param>
        public IEnumerator CreateUser(
            Request.CreateUserRequest request,
            UnityAction <AsyncResult <Result.CreateUserResult> > callback
            )
        {
            var task = new CreateUserTask(request, callback);

            return(Gs2RestSession.Execute(task));
        }
Exemplo n.º 2
0
        public void GettersAndSetters_Invoked_StoreAndReturnData()
        {
            var Tags = new List <Guid> {
                Guid.NewGuid(), Guid.NewGuid()
            };

            var request = new CreateUserTask()
            {
                Tags = Tags
            };

            Assert.Equal(Tags, request.Tags);
        }
Exemplo n.º 3
0
        public void CreateQueue_Should_CreateQueue()
        {
            // Setup
            // TODO: Replace this with a mocked factory.
            IAwsClientFactory awsClientFactory = new AwsClientFactory();
            ITaskLogger       logger           = new NullLogger();

            var task = new CreateUserTask(awsClientFactory, logger)
            {
                EncryptionContainerName = TestHelper.EncryptionContainerName,
                UserName = userName,
            };

            // Execute
            bool suceeded = task.Execute();

            // Test
            Assert.IsTrue(suceeded, "Did not suceed");
            Assert.IsNotNullOrEmpty(task.UserId, "UserId");
            Assert.IsNotNullOrEmpty(task.Arn, "Arn");
        }
Exemplo n.º 4
0
        public async Task CreateUserTaskAsync_Normal_ExecutesRequestProperly()
        {
            (var client, var handler) = InstrumentedTaskClient();

            string exampleResponse = "{\r\n    \"success\": true,\r\n    \"data\": {\r\n        \"text\": \"Test API Params\",\r\n        \"type\": \"todo\",\r\n        \"notes\": \"\",\r\n        \"tags\": [],\r\n        \"value\": 0,\r\n        \"priority\": 1,\r\n        \"attribute\": \"str\",\r\n        \"challenge\": {\r\n            \"id\": \"f23c12f2-5830-4f15-9c36-e17fd729a812\"\r\n        },\r\n        \"group\": {\r\n            \"assignedUsers\": [],\r\n            \"approval\": {\r\n                \"required\": false,\r\n                \"approved\": false,\r\n                \"requested\": false\r\n            }\r\n        },\r\n        \"reminders\": [],\r\n        \"_id\": \"4a29874c-0308-417b-a909-2a7d262b49f6\",\r\n        \"createdAt\": \"2017-01-13T21:23:05.949Z\",\r\n        \"updatedAt\": \"2017-01-13T21:23:05.949Z\",\r\n        \"checklist\": [],\r\n        \"collapseChecklist\": false,\r\n        \"completed\": false,\r\n        \"id\": \"4a29874c-0308-417b-a909-2a7d262b49f6\"\r\n    },\r\n    \"notifications\": []\r\n}";

            handler.Response = exampleResponse.WrapResponseBody();

            var task = new CreateUserTask()
            {
                Text = "Text", Type = "daily"
            };
            var tasks = new List <CreateUserTask> {
                task
            };

            _ = await client.CreateUserTaskAsync(tasks);

            var request = handler.LastRequest;

            Assert.Equal("/api/v3/tasks/user", request.RequestUri.AbsolutePath);
            Assert.Equal("", request.RequestUri.Query);
            Assert.Equal(tasks.ToJson(), handler.LastRequestStringContent);
        }
Exemplo n.º 5
0
 public override void RegisterRealTasks(PhysicalServer site)
 {
     var task = new CreateUserTask(site.Name, _database, _user);
     site.AddTask(task);
 }
Exemplo n.º 6
0
        public override void RegisterRealTasks(PhysicalServer site)
        {
            var task = new CreateUserTask(site.Name, _database, _user);

            site.AddTask(task);
        }