public void Setup()
 {
     controladorConsumos = new ConsumosController(new RepositorioConsumosStub());
     controladorConsumos.Request = new HttpRequestMessage();
     controladorConsumos.Request.Properties.Add(HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration());
 }
        public void DadoRegistracionFalla_RetornaBadRequestConLaCausaDeLaFalla()
        {
            RepositorioConsumosStub repositorioConsumos = new RepositorioConsumosStub();
            ConsumosController controladorConsumos = new ConsumosController(repositorioConsumos);
            controladorConsumos.Request = new HttpRequestMessage();
            controladorConsumos.Request.Properties.Add(HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration());

            repositorioConsumos.RetornarErrorConCausa("descripcion del error", "nombre del usuario");

            Action registrarConsumo = () => controladorConsumos.RegistrarConsumo(Consumos.Almuerzo());
            registrarConsumo.ShouldThrow<HttpResponseException>()
                .Where(ex => EsBadRequest(ex, "descripcion del error", "nombre del usuario"));
        }