// Test PUT for update budget public void BudgetsController_Update_ReturnsNoContentResultAndCreatedbject_WhenParametersAreValid() { //Arrange Budget budget = new Budget() { Id = 1, From = 0, To = 100, Currency = "EUR", }; int id = 1; //Act var result = controller.Update(id, budget); var resultAsObject = controller.Get(budget.Id) as ObjectResult; var resultObject = resultAsObject.Value as Budget; //Assert Assert.IsType <NoContentResult>(result); Assert.Equal(budget.From, resultObject.From); }