Ejemplo n.º 1
0
        public async Task LaunchCreateTaskFromFakeHandler(CreateConfiguration config)
        {
            FakeHTTP.ReturnMessage = HttpTaskObject.TaskResponseBody;
            var    createTask      = new ApiObjectCreator.CreateNewTask(Tool);
            var    commandLauncher = new CreateCommandLauncher(createTask, FormatTable, FakeApi);
            string ret             = await commandLauncher.RunAndPrintCommandAsync(config, FalsePrinter);

            string expected = "Uuid : f78fdff8-7081-46e1-bb2f-d9cd4e185ece" + Environment.NewLine + "Message : New task created, state : Success" + Environment.NewLine;

            Assert.AreEqual(ret, expected);
        }
Ejemplo n.º 2
0
        public async Task CreateJobFromFakeHandlerReturnTheGoodUuid()
        {
            FakeHTTP.ReturnMessage = HttpJobObject.JobResponseBody;
            CreateConfiguration config = new CreateConfiguration(ConfigType.Job, CommandApi.Create);
            var    createJob           = new ApiObjectCreator.CreateNewJob(Tool);
            var    commandLauncher     = new CreateCommandLauncher(createJob, FormatTable, FakeApi);
            string ret = await commandLauncher.RunAndPrintCommandAsync(config, FalsePrinter);

            string expected = "Uuid : f78fdff8-7081-46e1-bb2f-d9cd4e185ece" + Environment.NewLine + "Message : New job created, state : Success" + Environment.NewLine;

            Assert.AreEqual(ret, expected);
        }
Ejemplo n.º 3
0
        public async Task CreatePoolFromFakeHandlerReturnTheGoodUuid()
        {
            FakeHTTP.ReturnMessage = HttpPoolObject.PoolResponseBody;
            CreateConfiguration config = new CreateConfiguration(ConfigType.Pool, CommandApi.Create);

            config.Constants = new List <string>()
            {
                "key1=val1", "key2=val2"
            };
            config.Constraints = new List <string>()
            {
                "key1=val1", "key2=val2"
            };
            config.TasksDefaultWaitForPoolResourcesSynchronization = true;
            var    createPool      = new ApiObjectCreator.CreateNewPool(Tool);
            var    commandLauncher = new CreateCommandLauncher(createPool, FormatTable, FakeApi);
            string ret             = await commandLauncher.RunAndPrintCommandAsync(config, FalsePrinter);

            string expected = "Uuid : f78fdff8-7081-46e1-bb2f-d9cd4e185ece" + Environment.NewLine + "Message : New pool created, state : Success" + Environment.NewLine;

            Assert.AreEqual(ret, expected);
        }