예제 #1
0
        public void Setup()
        {
            _createGitLabGroupCommand      = A.Fake <ICreateGitLabGroupCommand>();
            _createGitLabProjectCommand    = A.Fake <ICreateGitLabProjectCommand>();
            _pushToGitLabRepositoryCommand = A.Fake <IPushToGitLabRepositoryCommand>();
            _gitLabProjectFactory          = A.Fake <IGitLabProjectFactory>();
            _gitLabGroupFactory            = A.Fake <IGitLabGroupFactory>();

            _pushToRepositoryResponse = new PushToRepositoryResponse()
            {
                Successful = true
            };

            _group               = new Group();
            _project             = new Project();
            _createSolutionModel = new CreateSolutionModel();

            A.CallTo(() => _pushToGitLabRepositoryCommand.ExecuteAsync(A <PushToRepositoryRequest> ._))
            .Returns(_pushToRepositoryResponse);

            A.CallTo(() => _createGitLabGroupCommand.ExecuteAsync(A <Group> ._)).Returns(_group);
            A.CallTo(() => _createGitLabProjectCommand.ExecuteAsync(A <Project> ._)).Returns(_project);

            _sut = new CreateGitLabSolutionCommand(_createGitLabGroupCommand, _createGitLabProjectCommand,
                                                   _pushToGitLabRepositoryCommand, _gitLabProjectFactory, _gitLabGroupFactory);
        }
 public CreateGitLabSolutionCommand(ICreateGitLabGroupCommand createGitLabGroupCommand,
                                    ICreateGitLabProjectCommand createGitLabProjectCommand,
                                    IPushToGitLabRepositoryCommand pushToGitLabRepositoryCommand,
                                    IGitLabProjectFactory gitLabProjectFactory,
                                    IGitLabGroupFactory gitLabGroupFactory)
 {
     _createGitLabGroupCommand      = createGitLabGroupCommand;
     _createGitLabProjectCommand    = createGitLabProjectCommand;
     _pushToGitLabRepositoryCommand = pushToGitLabRepositoryCommand;
     _gitLabProjectFactory          = gitLabProjectFactory;
     _gitLabGroupFactory            = gitLabGroupFactory;
 }