public void GetOfferByIdTest() { int id = 1; IHttpActionResult result = _controller.Get(id); var contentResult = result as OkNegotiatedContentResult <Offer>; Offer o = _context.Offers.FirstOrDefault(of => of.Id == id); Assert.IsNotNull(o); Assert.IsNotNull(contentResult); Assert.IsNotNull(contentResult.Content); Assert.AreEqual(o.VendorId, contentResult.Content.VendorId); }