public void SaveCase(Case fogbugzCase)
        {
            var parameters = new Dictionary<string, string>();

            if (fogbugzCase.TagsUpdated)
                parameters.Add("sTags", string.Join(",", fogbugzCase.GetTags().ToArray()));
            if (fogbugzCase.SubjectUpdated)
                parameters.Add("sTitle", fogbugzCase.Subject);
            if (fogbugzCase.DueUpdated && fogbugzCase.Due != null)
                parameters.Add("dtDue", fogbugzCase.Due.Value.ToUniversalTime().ToString("s", CultureInfo.InvariantCulture));

            if (parameters.Count > 0)
            {
                UpdateFogbugzUser();

                parameters.Add("ixBug", fogbugzCase.CaseId.ToString());
                parameters.Add("ixPersonEditedBy", _fogbugzUser.UserId.ToString());

                var fogbugzResponse = MakeFogbugzRequest("edit", parameters);

                Log.DebugFormat("Response received from Fogbugz: {0}", fogbugzResponse);
            }

            if (fogbugzCase.ResolvedUpdated && fogbugzCase.Resolved)
            {
                    parameters.Add("ixBug", fogbugzCase.CaseId.ToString());
                    parameters.Add("ixPersonEditedBy", _fogbugzUser.UserId.ToString());

                    var fogbugzResponse = MakeFogbugzRequest("resolve", parameters);

                    Log.DebugFormat("Response received from Fogbugz: {0}", fogbugzResponse);
            }
        }
Example #2
0
        public void GetTags()
        {
            var c = new Case();
            c.AddTag("boom");
            c.AddTag("boom2");

            var tags = c.GetTags().ToList();

            Assert.AreEqual(2, tags.Count());
            Assert.AreEqual("boom", tags[0]);
            Assert.AreEqual("boom2", tags[1]);
        }