public void CreateDevice_Success() { //Arrange _deviceController.ControllerContext.Request.Properties["UserDetails"] = GetValidUserDomain(); // Act IHttpActionResult actionResult = _deviceController.CreateDevice(GetValidCreateDeviceDomain()); var contentResult = actionResult as NegotiatedContentResult <int>; // Assert Assert.IsNotNull(contentResult); Assert.AreEqual(HttpStatusCode.Created, contentResult.StatusCode); Assert.AreEqual(1, contentResult.Content); }