public void WhenPropertiesAreRequested_PropertyValuesAreReturned()
        {
            var properties = PropertiesAvailableStatusFactory.CreateUIPropertyEditorPropertiesAvailableStatus(includeName: true);

            var context = IQueryExecutionContextFactory.Create();
            var id      = new EntityIdentity(key: "EditorKey", value: "bbb");
            var editor  = new ValueEditor {
                EditorType = "My.Editor.Type"
            };

            var result = (UIPropertyEditorValue)UIPropertyEditorDataProducer.CreateEditorValue(context, id, editor, properties);

            Assert.Equal(expected: "My.Editor.Type", actual: result.Name);
        }
        public void WhenAnEditorValueIsCreated_TheEditorIsTheProviderState()
        {
            var properties = PropertiesAvailableStatusFactory.CreateUIPropertyEditorPropertiesAvailableStatus(includeName: true);

            var context = IQueryExecutionContextFactory.Create();
            var id      = new EntityIdentity(key: "EditorKey", value: "bbb");
            var editor  = new ValueEditor {
                EditorType = "My.Editor.Type"
            };

            var result = (UIPropertyEditorValue)UIPropertyEditorDataProducer.CreateEditorValue(context, id, editor, properties);

            Assert.Equal(expected: editor, actual: ((IEntityValueFromProvider)result).ProviderState);
        }
        public void WhenCreatingAnEntityFromAParentAndEditor_TheIdIsTheEditorType()
        {
            var properties = PropertiesAvailableStatusFactory.CreateUIPropertyEditorPropertiesAvailableStatus(includeName: false);

            var context      = IQueryExecutionContextFactory.Create();
            var parentEntity = IEntityWithIdFactory.Create(key: "parentId", value: "aaa");
            var editor       = new ValueEditor {
                EditorType = "My.Editor.Type"
            };

            var result = (UIPropertyEditorValue)UIPropertyEditorDataProducer.CreateEditorValue(context, parentEntity, editor, properties);

            Assert.Equal(expected: "My.Editor.Type", actual: result.Id[ProjectModelIdentityKeys.EditorName]);
        }