public void Put_UpdatedStatus_BaggageNotFound() { var baggageToUpdate = BaggageBuilder.Create().Build(); var toUpdatedBaggageDTO = _baggageMapper.CreateDTO(baggageToUpdate); var result = _baggageController.Put(-1, toUpdatedBaggageDTO); Assert.IsInstanceOf <BadRequestObjectResult>(result.Result); }
public void Put_UpdatedStatus_AttributeRequired() { var baggageToUpdate = BaggageBuilder.Create().Build(); var toUpdatedBaggageDTO = _baggageMapper.CreateDTO(baggageToUpdate); var result = _baggageController.Put(_baggagedto.Id, toUpdatedBaggageDTO); Assert.IsInstanceOf <ObjectResult>(result.Result); }
public Baggage CreateEntity(BaggageDTO dto) { return(BaggageBuilder.Create() .WithDescription(dto.Description) .WithStatus(dto.Status) .WithId(dto.Id) .Build()); }
public void UpdateBaggageTest() { var toUpdatedBaggage = BaggageBuilder.Create() .WithStatus("RECLAMADO") .Build(); var updatedBaggage = _baggageDao.Update(_baggage.Id, toUpdatedBaggage); Assert.AreEqual(toUpdatedBaggage.Status, updatedBaggage.Status); }
public void SetUp() { _baggage = BaggageBuilder.Create() .WithStatus("EXTRAVIADO") .WithDescription("maleta roja") .WithId(6) .Build(); _baggageDao = (PostgresBaggageDao)DAOFactory.GetFactory(DAOFactory.Type.Postgres).GetBaggageDao(); }
public void Setup() { _baggageController = new BaggageController(null); var baggage = BaggageBuilder.Create() .WithDescription("Bolso negro extraviado en el areopuerto de maiquetia") .WithId(6) .WithStatus("EXTRAVIADO") .Build(); _baggageMapper = MapperFactory.CreateBaggageMapper(); _baggagedto = _baggageMapper.CreateDTO(baggage); }
public void Validate_BaggageWithWrongStatus_AttributeValueExThrown() { var baggage = BaggageBuilder.Create() .WithDescription("epale") .WithStatus("epale2") .Build(); Assert.Throws <AttributeValueException>(() => { BaggageValidator.Validate(baggage); }); }
public void ValidateUpdate_BaggageWithStatusAndDescription_AttributeValueExThrown() { var baggage = BaggageBuilder.Create() .WithDescription("epale") .WithStatus("epale2") .Build(); Assert.Throws <AttributeValueException>(() => { BaggageValidator.Validate(baggage, HttpMethod.Put); }); }