public Guid CreateCustomField(Guid agencyId, Guid dataEntrySectionId, DTO.CustomDataEntryFieldDetails details)
        {
            var section  = UnitOfWork.Find <DataEntrySection>(dataEntrySectionId);
            var newField = section.CreateCustomField(details.Name, details.ControlType, agencyId);

            details.MapInto(newField);
            UnitOfWork.Commit();
            return(newField.Id);
        }
        public void CreateCustomField()
        {
            var metadataUnitOfWork = new Mock <IMetadataUnitOfWork>();
            var dataEntryMetadataCommandService = new DataEntryMetadataCommandService(metadataUnitOfWork.Object, Mock.Of <ILog>(), Mock.Of <IServiceAuthorizationPolicy>(), Mock.Of <IServiceIdentityProvider>());

            var dataEntrySection = new DataEntrySection();

            metadataUnitOfWork.Setup(mock => mock.Find <DataEntrySection>(It.IsAny <Guid>(), TrackingMode.Automatic, ThrowIf.Anything)).Returns(dataEntrySection);

            var customDataEntryFieldDetails = new DTO.CustomDataEntryFieldDetails();

            customDataEntryFieldDetails.Name        = "Custom Field";
            customDataEntryFieldDetails.ControlType = ControlType.Text;

            var customFieldId = dataEntryMetadataCommandService.CreateCustomField(It.IsAny <Guid>(), It.IsAny <Guid>(), customDataEntryFieldDetails);

            customFieldId.Should().NotBeEmpty();
            metadataUnitOfWork.VerifyAll();
        }