private async Task <ICommandResult <Project> > CreateProject(UploadTestResultCommand command)
        {
            var createProjectCommand = new CreateProjectCommand(command.ProjectName);
            var projectCommandResult = await _projectCommandHandler.ExecuteAsync(createProjectCommand);

            return(projectCommandResult);
        }
        public async Task <ICommandResult> ExecuteAsync(UploadTestResultCommand command)
        {
            var parser      = ParserFactory.Create(command.FileType);
            var parseResult = parser.Parse(command.Stream);

            var projectCommandResult = await CreateProject(command);

            if (!projectCommandResult.Success)
            {
                return(FailedResult());
            }

            var project = projectCommandResult.Result;

            var buildCommandResult = await CreateBuild(parseResult, project);

            if (!buildCommandResult.Success)
            {
                return(FailedResult());
            }

            var build = buildCommandResult.Result;
            var testResultCommandResult = await CreateTestResults(build, parseResult);

            return(testResultCommandResult.Success ? SuccessResult() : FailedResult());
        }