Beispiel #1
0
        public When_FluentMetadataBuilder_builds_metadata_copying_from_non_existing_metadata()
        {
            FluentMetadataBuilder.Reset();

            try
            {
                FluentMetadataBuilder.BuildMetadataDefinitions(
                    GetUnbuildableMetadataDefinitions());
            }
            catch (Exception ex)
            {
                exception = ex;
            }
        }
        public When_FluentMetadataBuilder_builds_copying_metadata_with_circular_references()
        {
            FluentMetadataBuilder.Reset();

            try
            {
                FluentMetadataBuilder.BuildMetadataDefinitions(
                    GetUnbuildableMetadataDefinitions());
            }
            catch (Exception ex)
            {
                exception = ex;
            }
        }
        public When_FluentMetadataBuilder_builds_metadata_copying_from_other_metadata_that_does_not_apply()
        {
            FluentMetadataBuilder.Reset();

            try
            {
                FluentMetadataBuilder.BuildMetadataDefinitions(GetUnbuildableMetadataDefinitions());
                someViewModelRules           = QueryFluentMetadata.GetMetadataFor(typeof(SomeViewModel)).Rules;
                someViewModelMyPropertyRules = QueryFluentMetadata.GetMetadataFor(typeof(SomeViewModel), "MyProperty").Rules;
            }
            catch (Exception ex)
            {
                exception = ex;
            }
        }
Beispiel #4
0
 public MetadataSetup()
 {
     FluentMetadataBuilder.Reset();
     try
     {
         FluentMetadataBuilder.BuildMetadataDefinitions(
             typeof(Person).Assembly.GetTypes()
             .Where(t => t.Is <IClassMetadata>())
             .Except(When_FluentMetadataBuilder_builds_metadata_copying_from_other_metadata.GetUnbuildableMetadataDefinitions())
             .Except(When_FluentMetadataBuilder_builds_metadata_copying_from_other_metadata_that_does_not_apply.GetUnbuildableMetadataDefinitions())
             .Except(When_FluentMetadataBuilder_builds_copying_metadata_with_circular_references.GetUnbuildableMetadataDefinitions())
             .Except(When_FluentMetadataBuilder_builds_metadata_copying_from_non_existing_metadata.GetUnbuildableMetadataDefinitions()));
     }
     catch (Exception ex)
     {
         Exception = ex;
     }
 }
        public When_FluentMetadataBuilder_builds_metadata_copying_from_other_metadata()
        {
            FluentMetadataBuilder.Reset();
            var typesToBuildInLaterBatch = new[] { typeof(SomeTypeInAnotherAssemblyMetadata) };

            try
            {
                FluentMetadataBuilder.BuildMetadataDefinitions(
                    GetUnbuildableMetadataDefinitions()
                    .Except(typesToBuildInLaterBatch));
                FluentMetadataBuilder.BuildMetadataDefinitions(typesToBuildInLaterBatch);
                someViewModelRules                 = QueryFluentMetadata.GetMetadataFor(typeof(SomeViewModel)).Rules;
                someViewModelMyPropertyRules       = QueryFluentMetadata.GetMetadataFor(typeof(SomeViewModel), "MyProperty").Rules;
                someViewModelMyStringPropertyRules = QueryFluentMetadata.GetMetadataFor(typeof(SomeViewModel), "MyStringProperty").Rules;
            }
            catch (Exception ex)
            {
                exception = ex;
            }
        }