Skip to content

Commit 7a6b563

Browse files
Update Unit Test
1 parent a1ba5a1 commit 7a6b563

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

14/umbraco-cms/implementation/unit-testing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,15 @@ public class ProductsControllerTests
197197

198198
var result = this.controller.GetAllProducts();
199199

200-
Assert.AreEqual(expected, result);
200+
Assert.That(expected == result);
201201
}
202202

203203
[Test]
204204
public void WhenGetAllProductsJson_ThenReturnViewModelWithExpectedJson()
205205
{
206-
var json = serializer.Serialize(this.controller.GetAllProductsJson().Value);
206+
var json = JsonSerializer.Serialize(this.controller.GetAllProductsJson().Value);
207207

208-
Assert.AreEqual("[\"Table\",\"Chair\",\"Desk\",\"Computer\",\"Beer fridge\"]", json);
208+
Assert.That("[\"Table\",\"Chair\",\"Desk\",\"Computer\",\"Beer fridge\"]" == json);
209209
}
210210
}
211211
```

15/umbraco-cms/implementation/unit-testing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,15 @@ public class ProductsControllerTests
197197

198198
var result = this.controller.GetAllProducts();
199199

200-
Assert.AreEqual(expected, result);
200+
Assert.That(expected == result);
201201
}
202202

203203
[Test]
204204
public void WhenGetAllProductsJson_ThenReturnViewModelWithExpectedJson()
205205
{
206-
var json = serializer.Serialize(this.controller.GetAllProductsJson().Value);
206+
var json = JsonSerializer.Serialize(this.controller.GetAllProductsJson().Value);
207207

208-
Assert.AreEqual("[\"Table\",\"Chair\",\"Desk\",\"Computer\",\"Beer fridge\"]", json);
208+
Assert.That("[\"Table\",\"Chair\",\"Desk\",\"Computer\",\"Beer fridge\"]" == json);
209209
}
210210
}
211211
```

0 commit comments

Comments
 (0)