Beispiel #1
0
        public void GetAllAdditionalFieldsTest()
        {
            var afs = new List <AdditionalFieldEntity>()
            {
                testAFEntity
            };

            AFRepository.Setup(x => x.GetAll()).Returns(afs);

            var result = aFLogic.GetAll();

            AFRepository.VerifyAll();
            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.Count());
            Assert.AreEqual(result.FirstOrDefault(), testAFEntity);
        }
Beispiel #2
0
        public ActionResult Get()
        {
            IEnumerable <AdditionalFieldEntity> additionalFields;

            try
            {
                additionalFields = additionalFieldLogic.GetAll();
            }
            catch (ArgumentException ex)
            {
                return(BadRequest(ex.Message));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
            var additionalFieldOut = mapper.Map <IEnumerable <AdditionalFieldEntity>, IEnumerable <AdditionalFieldModelOut> >(additionalFields);

            return(this.Ok(additionalFieldOut));
        }
 public IActionResult Get()
 {
     return(Ok(AdditionalFieldDTO.ToModel(Logic.GetAll())));
 }