Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public Baggage CreateEntity(BaggageDTO dto)
 {
     return(BaggageBuilder.Create()
            .WithDescription(dto.Description)
            .WithStatus(dto.Status)
            .WithId(dto.Id)
            .Build());
 }
Ejemplo n.º 4
0
        public void UpdateBaggageTest()
        {
            var toUpdatedBaggage = BaggageBuilder.Create()
                                   .WithStatus("RECLAMADO")
                                   .Build();
            var updatedBaggage = _baggageDao.Update(_baggage.Id, toUpdatedBaggage);

            Assert.AreEqual(toUpdatedBaggage.Status, updatedBaggage.Status);
        }
Ejemplo n.º 5
0
 public void SetUp()
 {
     _baggage = BaggageBuilder.Create()
                .WithStatus("EXTRAVIADO")
                .WithDescription("maleta roja")
                .WithId(6)
                .Build();
     _baggageDao = (PostgresBaggageDao)DAOFactory.GetFactory(DAOFactory.Type.Postgres).GetBaggageDao();
 }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        public void Validate_BaggageWithWrongStatus_AttributeValueExThrown()
        {
            var baggage = BaggageBuilder.Create()
                          .WithDescription("epale")
                          .WithStatus("epale2")
                          .Build();

            Assert.Throws <AttributeValueException>(() =>
            {
                BaggageValidator.Validate(baggage);
            });
        }
Ejemplo n.º 8
0
        public void ValidateUpdate_BaggageWithStatusAndDescription_AttributeValueExThrown()
        {
            var baggage = BaggageBuilder.Create()
                          .WithDescription("epale")
                          .WithStatus("epale2")
                          .Build();

            Assert.Throws <AttributeValueException>(() =>
            {
                BaggageValidator.Validate(baggage, HttpMethod.Put);
            });
        }