コード例 #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);
        }
コード例 #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);
        }
コード例 #3
0
 public Baggage CreateEntity(BaggageDTO dto)
 {
     return(BaggageBuilder.Create()
            .WithDescription(dto.Description)
            .WithStatus(dto.Status)
            .WithId(dto.Id)
            .Build());
 }
コード例 #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);
        }
コード例 #5
0
 public void SetUp()
 {
     _baggage = BaggageBuilder.Create()
                .WithStatus("EXTRAVIADO")
                .WithDescription("maleta roja")
                .WithId(6)
                .Build();
     _baggageDao = (PostgresBaggageDao)DAOFactory.GetFactory(DAOFactory.Type.Postgres).GetBaggageDao();
 }
コード例 #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);
        }
コード例 #7
0
        public void Validate_BaggageWithWrongStatus_AttributeValueExThrown()
        {
            var baggage = BaggageBuilder.Create()
                          .WithDescription("epale")
                          .WithStatus("epale2")
                          .Build();

            Assert.Throws <AttributeValueException>(() =>
            {
                BaggageValidator.Validate(baggage);
            });
        }
コード例 #8
0
        public void ValidateUpdate_BaggageWithStatusAndDescription_AttributeValueExThrown()
        {
            var baggage = BaggageBuilder.Create()
                          .WithDescription("epale")
                          .WithStatus("epale2")
                          .Build();

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