Exemple #1
0
        public static void Initialise(string solutionPath, CoreSettings settings, IRbClient client)
        {
            if (solutionPath == null)
            {
                throw new ArgumentNullException("solutionPath");
            }
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            SolutionPath = solutionPath;
            Settings     = settings;

            Config      = new ReviewBoardRc(solutionPath);
            ScmProvider = new ScmProviderDetector(solutionPath).DetectProvider();
            switch (ScmProvider)
            {
            case ScmProvider.None:
                throw new ApplicationException("not under source control");

            case ScmProvider.Git:
                CodeRepository = new GitRepository(solutionPath);
                break;

            case ScmProvider.Svn:
                CodeRepository = new SvnRepository(solutionPath);
                break;
            }

            RbClient = client;
            RbClient.AuthenticationRequired += OnAuthenticationRequired;
            RbClient.AuthCookieChanged      += OnAuthCookieChanged;
        }
 public void SetUp()
 {
     _client = RbFactory.CreateHttpClient(@"c:\dev\ironboard", null);
     _client.Authenticate(new NetworkCredential("igavryliuk", "M1m3c45t"));
 }