public void UpdateCostPerMinuteValue() { CostPerMinute aCost = new CostPerMinute() { Value = 1, CountryTag = "UY" }; costRepository.Context.Costs.Add(aCost); costRepository.Context.SaveChanges(); aCost.Value = 2; costRepository.Update(aCost); Assert.AreEqual(costRepository.Get("", aCost.CountryTag).Value, 2); }
public async Task Put(CostViewModel viewModel) { var data = new Cost { Id = viewModel.Id, StatementDate = viewModel.StatementDate, Amount = viewModel.Amount, CategoryId = viewModel.CategoryId, UserId = viewModel.UserId }; var result = await _costRepository.Update(data); Response.StatusCode = result ? 200 : 400; }