Exemplo n.º 1
0
        public void when_calling_resolve_bug_the_bug_status_should_change()
        {
            int    ID         = 7;
            string status     = "RESOLVED";
            string resolution = "FIXED";
            IBug   bug        = _client.GetBug(ID);

            _client.ResolveBug(Int32.Parse(bug.ID), resolution);

            bug = _client.GetBug(ID);

            Assert.AreEqual(bug.Status, status);
        }
        private void ResolveBugIfRequired(string resolution, int bugId, IBugzillaClient client)
        {
            try
            {
                if (string.IsNullOrEmpty(resolution))
                {
                    throw new Exception("There was an attempt to resolve a bug without having a configured resolution value.");
                }

                if (!client.ResolveBug(bugId, resolution))
                {
                    logger.Log(LogMessage.SeverityType.Error, string.Format("Failed to resolve bug to {0}.", resolution));
                }
            }
            catch (Exception ex)
            {
                logger.Log(LogMessage.SeverityType.Error, "Failed to resolve bug: " + ex.InnerException.Message);
            }
        }
        private void ResolveBugIfRequired(string resolution, int bugId, IBugzillaClient client) 
        {
            if(string.IsNullOrEmpty(resolution)) 
            {
                return;
            }

            try 
            {
                if(!client.ResolveBug(bugId, resolution, string.Empty)) 
                {
                    logger.Log(LogMessage.SeverityType.Error, string.Format("Failed to resolve bug to {0}.", resolution));
                }
            } catch(BugzillaException ex) 
            {
                logger.Log(LogMessage.SeverityType.Error, "Failed to resolve bug: " + ex.InnerException.Message);
            }
        }