Skip to content

Commit 835676e

Browse files
committed
Fix spaces to tabs to match existing repo settings
1 parent 5d80fca commit 835676e

1 file changed

Lines changed: 70 additions & 70 deletions

File tree

Rally.RestApi.Test/RallyRestApiTest.cs

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ public void CreateTest2x()
114114

115115
private void AssertCanCreate(RallyRestApi restApi)
116116
{
117-
var dynamicJson = new DynamicJsonObject();
118-
dynamicJson["Name"] = "C# Json Rest Toolkit Test Defect";
119-
CreateResult response = restApi.Create("defect", dynamicJson);
120-
Assert.AreEqual(0, response.Errors.Count);
121-
Assert.IsTrue(response.Reference.ToLower().Contains("defect"));
122-
dynamic testDefect = restApi.GetByReference(response.Reference);
123-
Assert.AreEqual(dynamicJson["Name"], testDefect.Name);
124-
117+
var dynamicJson = new DynamicJsonObject();
118+
dynamicJson["Name"] = "C# Json Rest Toolkit Test Defect";
119+
CreateResult response = restApi.Create("defect", dynamicJson);
120+
Assert.AreEqual(0, response.Errors.Count);
121+
Assert.IsTrue(response.Reference.ToLower().Contains("defect"));
122+
dynamic testDefect = restApi.GetByReference(response.Reference);
123+
Assert.AreEqual(dynamicJson["Name"], testDefect.Name);
124+
125125
// Now delete it
126126
TestHelperDeleteItem(restApi, response.Reference);
127127
}
@@ -151,54 +151,54 @@ private void AssertCreateFailure(RallyRestApi restApi)
151151
Assert.IsFalse(creationResult.Success);
152152
}
153153

154-
[TestMethod]
155-
public void AddToCollection2x()
156-
{
157-
RallyRestApi restApi = GetRallyRestApi2x();
158-
var itemRef = TestHelperCreateDefect(restApi);
159-
DynamicJsonObject newTask = new DynamicJsonObject();
160-
newTask["Name"] = "New Task Added via collection";
161-
NameValueCollection parameters = new NameValueCollection();
162-
parameters.Add("fetch", "FormattedID");
163-
OperationResult result = restApi.AddToCollection(itemRef, "Tasks", new List<DynamicJsonObject>() { newTask }, parameters);
164-
Assert.IsTrue(result.Success);
165-
Assert.AreEqual(1, result.Results.Count);
166-
Assert.IsNotNull(result.Results[0]["FormattedID"]);
167-
168-
// Now delete it
169-
TestHelperDeleteItem(restApi, itemRef);
170-
}
171-
172-
[TestMethod]
173-
public void RemoveFromCollection2x()
174-
{
175-
RallyRestApi restApi = GetRallyRestApi2x();
176-
DynamicJsonObject newStory = new DynamicJsonObject();
177-
newStory["Name"] = "Test Story";
178-
var itemRef = restApi.Create("hierarchicalrequirement", newStory).Reference;
179-
DynamicJsonObject newDefect = new DynamicJsonObject();
180-
newDefect["Name"] = "New Defect Added via collection";
181-
newDefect["Requirement"] = itemRef;
182-
CreateResult newTaskResult = restApi.Create("defect", newDefect);
183-
184-
DynamicJsonObject story = restApi.GetByReference(itemRef, "Defects");
185-
Assert.AreEqual(1, story["Defects"]["Count"]);
186-
187-
DynamicJsonObject taskToRemove = new DynamicJsonObject();
188-
taskToRemove["_ref"] = newTaskResult.Reference;
189-
OperationResult result = restApi.RemoveFromCollection(itemRef, "Defects", new List<DynamicJsonObject>() { taskToRemove }, new NameValueCollection());
190-
191-
Assert.IsTrue(result.Success);
192-
Assert.AreEqual(0, result.Results.Count);
193-
story = restApi.GetByReference(itemRef, "Defects");
194-
Assert.AreEqual(0, story["Defects"]["Count"]);
195-
196-
// Now delete the defect and story
197-
TestHelperDeleteItem(restApi, newTaskResult.Reference);
198-
TestHelperDeleteItem(restApi, itemRef);
199-
}
200-
201-
[TestMethod]
154+
[TestMethod]
155+
public void AddToCollection2x()
156+
{
157+
RallyRestApi restApi = GetRallyRestApi2x();
158+
var itemRef = TestHelperCreateDefect(restApi);
159+
DynamicJsonObject newTask = new DynamicJsonObject();
160+
newTask["Name"] = "New Task Added via collection";
161+
NameValueCollection parameters = new NameValueCollection();
162+
parameters.Add("fetch", "FormattedID");
163+
OperationResult result = restApi.AddToCollection(itemRef, "Tasks", new List<DynamicJsonObject>() { newTask }, parameters);
164+
Assert.IsTrue(result.Success);
165+
Assert.AreEqual(1, result.Results.Count);
166+
Assert.IsNotNull(result.Results[0]["FormattedID"]);
167+
168+
// Now delete it
169+
TestHelperDeleteItem(restApi, itemRef);
170+
}
171+
172+
[TestMethod]
173+
public void RemoveFromCollection2x()
174+
{
175+
RallyRestApi restApi = GetRallyRestApi2x();
176+
DynamicJsonObject newStory = new DynamicJsonObject();
177+
newStory["Name"] = "Test Story";
178+
var itemRef = restApi.Create("hierarchicalrequirement", newStory).Reference;
179+
DynamicJsonObject newDefect = new DynamicJsonObject();
180+
newDefect["Name"] = "New Defect Added via collection";
181+
newDefect["Requirement"] = itemRef;
182+
CreateResult newTaskResult = restApi.Create("defect", newDefect);
183+
184+
DynamicJsonObject story = restApi.GetByReference(itemRef, "Defects");
185+
Assert.AreEqual(1, story["Defects"]["Count"]);
186+
187+
DynamicJsonObject taskToRemove = new DynamicJsonObject();
188+
taskToRemove["_ref"] = newTaskResult.Reference;
189+
OperationResult result = restApi.RemoveFromCollection(itemRef, "Defects", new List<DynamicJsonObject>() { taskToRemove }, new NameValueCollection());
190+
191+
Assert.IsTrue(result.Success);
192+
Assert.AreEqual(0, result.Results.Count);
193+
story = restApi.GetByReference(itemRef, "Defects");
194+
Assert.AreEqual(0, story["Defects"]["Count"]);
195+
196+
// Now delete the defect and story
197+
TestHelperDeleteItem(restApi, newTaskResult.Reference);
198+
TestHelperDeleteItem(restApi, itemRef);
199+
}
200+
201+
[TestMethod]
202202
public void Delete1x()
203203
{
204204
RallyRestApi restApi = GetRallyRestApi1x();
@@ -212,16 +212,16 @@ public void Delete2x()
212212
AssertCanDelete(restApi);
213213
}
214214

215-
private void AssertCanDelete(RallyRestApi restApi, bool includeFullData = false)
216-
{
217-
// Create test defect
218-
var defect = TestHelperCreateDefect(restApi, includeFullData);
219-
var defectOid = Ref.GetOidFromRef(defect);
215+
private void AssertCanDelete(RallyRestApi restApi, bool includeFullData = false)
216+
{
217+
// Create test defect
218+
var defect = TestHelperCreateDefect(restApi, includeFullData);
219+
var defectOid = Ref.GetOidFromRef(defect);
220220

221-
OperationResult deleteResponse = restApi.Delete(Ref.GetRelativeRef(defect));
222-
dynamic testDefectEmpty = restApi.GetByReference(defect);
223-
Assert.IsNull(testDefectEmpty);
224-
}
221+
OperationResult deleteResponse = restApi.Delete(Ref.GetRelativeRef(defect));
222+
dynamic testDefectEmpty = restApi.GetByReference(defect);
223+
Assert.IsNull(testDefectEmpty);
224+
}
225225

226226
[TestMethod]
227227
public void Update1x()
@@ -357,8 +357,8 @@ public void TestAttribute2x()
357357
public void FormatCreateString()
358358
{
359359
RallyRestApi restApi = GetRallyRestApi();
360-
NameValueCollection parameters = new NameValueCollection();
361-
parameters["fetch"] = "Name";
360+
NameValueCollection parameters = new NameValueCollection();
361+
parameters["fetch"] = "Name";
362362
Uri result = restApi.FormatCreateUri("defect", parameters);
363363
var expected = new Uri(Settings.Default.TestServer + "/slm/webservice/" + RallyRestApi.DEFAULT_WSAPI_VERSION + "/defect/create.js?fetch=Name");
364364
Assert.AreEqual(expected, result);
@@ -368,9 +368,9 @@ public void FormatCreateString()
368368
public void FormatUpdateString()
369369
{
370370
RallyRestApi restApi = GetRallyRestApi();
371-
NameValueCollection parameters = new NameValueCollection();
372-
parameters["fetch"] = "Name";
373-
Uri result = restApi.FormatUpdateUri("defect", "2121901027", parameters);
371+
NameValueCollection parameters = new NameValueCollection();
372+
parameters["fetch"] = "Name";
373+
Uri result = restApi.FormatUpdateUri("defect", "2121901027", parameters);
374374
var expected = new Uri(Settings.Default.TestServer + "/slm/webservice/" + RallyRestApi.DEFAULT_WSAPI_VERSION + "/defect/2121901027.js?fetch=Name");
375375
Assert.AreEqual(expected, result);
376376
}

0 commit comments

Comments
 (0)