Beispiel #1
0
        public void AddToCollection2x()
        {
            RallyRestApi      restApi = GetRallyRestApi2x();
            var               itemRef = TestHelperCreateDefect(restApi);
            DynamicJsonObject newTask = new DynamicJsonObject();

            newTask["Name"] = "New Task Added via collection";
            NameValueCollection parameters = new NameValueCollection();

            parameters.Add("fetch", "FormattedID");
            OperationResult result = restApi.AddToCollection(itemRef, "Tasks", new List <DynamicJsonObject>()
            {
                newTask
            }, parameters);

            Assert.IsTrue(result.Success);
            Assert.AreEqual(1, result.Results.Count);
            Assert.IsNotNull(result.Results[0]["FormattedID"]);

            // Now delete it
            TestHelperDeleteItem(restApi, itemRef);
        }