public void AdditionalFieldControllerPostTestWithRanges()
        {
            var id              = Guid.NewGuid();
            var type            = CreateContext();
            var Logic           = CreateLogic();
            var Controller      = new AdditionalFieldsController(Logic);
            var AdditionalField = new AdditionalField
            {
                Id        = id,
                Name      = "First AdditionalField",
                Type      = type,
                TypeId    = type.Id,
                FieldType = "Texto"
            };

            FieldRange range = new FieldRange()
            {
                AdditionalFieldId = id,
                Range             = "Range 1"
            };

            FieldRange range2 = new FieldRange()
            {
                AdditionalFieldId = id,
                Range             = "Range 2"
            };

            FieldRange range3 = new FieldRange()
            {
                AdditionalFieldId = id,
                Range             = "Range 3"
            };

            var RangeList = new List <FieldRange>()
            {
                range, range2, range3
            };

            AdditionalField.Ranges = RangeList;

            var result        = Controller.Post(AdditionalFieldDTO.ToModel(AdditionalField));
            var createdResult = result as CreatedAtRouteResult;
            var model         = createdResult.Value as AdditionalFieldDTO;

            Assert.AreEqual(AdditionalField.Ranges.Count, model.Ranges.Count);
        }
        public void AdditionalFieldControllerPostTest()
        {
            var type            = CreateContext();
            var Logic           = CreateLogic();
            var Controller      = new AdditionalFieldsController(Logic);
            var AdditionalField = new AdditionalField
            {
                Id        = Guid.NewGuid(),
                Name      = "First AdditionalField",
                Type      = type,
                TypeId    = type.Id,
                FieldType = "Entero"
            };

            FieldRange dummyRangeStart = new FieldRange()
            {
                AdditionalFieldId = AdditionalField.Id,
                Range             = "1"
            };

            FieldRange dummyRangeEnd = new FieldRange()
            {
                AdditionalFieldId = AdditionalField.Id,
                Range             = "10"
            };

            var DummyIntRangeList = new List <FieldRange>()
            {
                dummyRangeStart, dummyRangeEnd
            };

            AdditionalField.Ranges = DummyIntRangeList;


            var result        = Controller.Post(AdditionalFieldDTO.ToModel(AdditionalField));
            var createdResult = result as CreatedAtRouteResult;
            var model         = createdResult.Value as AdditionalFieldDTO;

            Assert.AreEqual(AdditionalField.Name, model.Name);
        }