public async Task CreateDashboard() { var insertedValues = new Dictionary <string, object> { { "Title", "Inserted title" }, { "OwnerTypeId", 2 }, { "DashboardConfig", "Inserted Dash Config" } }; var response1 = await Controller.CreateDashboard(new Dashboard { Title = insertedValues["Title"] as string, OwnerTypeId = (int)insertedValues["OwnerTypeId"], DashboardConfig = insertedValues["DashboardConfig"] as string }); var result1 = CustomAssert.AssertCreatedAtResponse(response1); Assert.AreEqual(result1.Title, insertedValues["Title"] as string); Assert.AreEqual(result1.OwnerTypeId, (int)insertedValues["OwnerTypeId"]); Assert.AreEqual(result1.DashboardConfig, insertedValues["DashboardConfig"] as string); // ReSharper disable once PossibleInvalidOperationException var response2 = await Controller.GetDashboard(result1.Id.Value); var result2 = CustomAssert.AssertOkResponse(response2); Assert.AreEqual(result2.Title, insertedValues["Title"] as string); Assert.AreEqual(result2.OwnerTypeId, (int)insertedValues["OwnerTypeId"]); Assert.AreEqual(result2.DashboardConfig, insertedValues["DashboardConfig"] as string); }