public void FromDictionaryConvertsValues()
        {
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary.Add("name", "value");
            List <NameValuePair> list = NameValuePair.FromDictionary(dictionary);

            Assert.AreEqual(1, dictionary.Count);
            Assert.AreEqual("name", list[0].Name);
            Assert.AreEqual("value", list[0].Value);
        }
        public void ForceBuild()
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            Expect.Call(serverClient.SessionToken).PropertyBehavior();
            Expect.Call(() =>
            {
                serverClient.ForceBuild("yyy", NameValuePair.FromDictionary(parameters));
            });
            mocks.ReplayAll();

            manager.ForceBuild(null, parameters, null);
            mocks.VerifyAll();
        }
        /// <summary>
        /// Starts a new integration result.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns>
        /// The new <see cref="IIntegrationResult"/>.
        /// </returns>
        public IIntegrationResult StartNewIntegration(IntegrationRequest request)
        {
            var result = resultManager.StartNewIntegration(request);

            // Copy any parameters to the result
            if ((request.BuildValues != null) && (request.BuildValues.Count > 0))
            {
                result.Parameters.AddRange(
                    NameValuePair.FromDictionary(request.BuildValues));
            }

            result.MarkStartTime();
            this.GenerateSystemParameterValues(result);
            return(result);
        }
예제 #4
0
        public void ForcesBuild()
        {
            var            parameters = new Dictionary <string, string>();
            MockRepository mocks      = new MockRepository();
            ServerAggregatingCruiseManagerWrapper serverWrapper = InitialiseServerWrapper(mocks,
                                                                                          delegate(CruiseServerClientBase manager)
            {
                Expect.Call(() => {
                    manager.ForceBuild(projectSpecifier.ProjectName, NameValuePair.FromDictionary(parameters));
                }).IgnoreArguments();
            });

            mocks.ReplayAll();

            serverWrapper.ForceBuild(projectSpecifier, null, parameters);
        }
예제 #5
0
 public void ForceBuild(string sessionToken, Dictionary <string, string> parameters, string userName)
 {
     try
     {
         manager.DisplayName  = userName;
         manager.SessionToken = sessionToken;
         if (parameters != null)
         {
             var buildValues = NameValuePair.FromDictionary(parameters);
             manager.ForceBuild(projectName, buildValues);
         }
         else
         {
             manager.ForceBuild(projectName);
         }
     }
     // Silently ignore exceptions that occur due to connection problems
     catch (System.Net.Sockets.SocketException)
     {
     }
     catch (System.Runtime.Remoting.RemotingException)
     {
     }
 }
        public void ForceBuild(IProjectSpecifier projectSpecifier, string sessionToken, Dictionary <string, string> parameters)
        {
            var manager = GetCruiseManager(projectSpecifier, sessionToken);

            manager.ForceBuild(projectSpecifier.ProjectName, NameValuePair.FromDictionary(parameters));
        }
        public void FromDictionaryHandlesNull()
        {
            List <NameValuePair> list = NameValuePair.FromDictionary(null);

            Assert.AreEqual(0, list.Count);
        }
예제 #8
0
 public void ForceBuild(string sessionToken, Dictionary <string, string> parameters, string userName)
 {
     client.SessionToken = sessionToken;
     client.DisplayName  = userName;
     client.ForceBuild(projectName, NameValuePair.FromDictionary(parameters));
 }
        public void ForceBuild()
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            Mock.Get(serverClient).SetupSet(_serverClient => _serverClient.SessionToken = It.IsAny <string>());
            Mock.Get(serverClient).Setup(_serverClient => _serverClient.ForceBuild("yyy", It.Is <List <NameValuePair> >(_parameters => _parameters.SequenceEqual(NameValuePair.FromDictionary(parameters)))));

            manager.ForceBuild(null, parameters, null);
            mocks.VerifyAll();
        }