public override void Process(IReflector reflector, Type type, IMethodRemover methodRemover, ISpecificationBuilder specification)
 {
     if (TimeValueSemanticsProvider.IsAdaptedType(type))
     {
         var spec = reflector.LoadSpecification <IObjectSpecImmutable>(TimeValueSemanticsProvider.AdaptedType);
         AddValueFacets(new TimeValueSemanticsProvider(spec, specification), specification);
     }
 }
예제 #2
0
        public override void SetUp()
        {
            base.SetUp();
            time   = new TimeSpan(8, 13, 0);
            holder = new Mock <ISpecification>().Object;
            var spec = new Mock <IObjectSpecImmutable>().Object;

            SetValue(adapter = new TimeValueSemanticsProvider(spec, holder));
        }
        public override IImmutableDictionary <string, ITypeSpecBuilder> Process(IReflector reflector, Type type, IMethodRemover methodRemover, ISpecificationBuilder specification, IImmutableDictionary <string, ITypeSpecBuilder> metamodel)
        {
            if (!TimeValueSemanticsProvider.IsAdaptedType(type))
            {
                return(metamodel);
            }

            var(oSpec, mm) = reflector.LoadSpecification <IObjectSpecImmutable>(TimeValueSemanticsProvider.AdaptedType, metamodel);
            AddValueFacets(new TimeValueSemanticsProvider(oSpec, specification), specification);
            return(mm);
        }
예제 #4
0
        public override IImmutableDictionary <string, ITypeSpecBuilder> Process(IReflector reflector, Type type, IMethodRemover methodRemover, ISpecificationBuilder specification, IImmutableDictionary <string, ITypeSpecBuilder> metamodel)
        {
            if (TimeValueSemanticsProvider.IsAdaptedType(type))
            {
                var result = reflector.LoadSpecification(TimeValueSemanticsProvider.AdaptedType, metamodel);

                metamodel = result.Item2;
                var spec = result.Item1 as IObjectSpecImmutable;
                AddValueFacets(new TimeValueSemanticsProvider(spec, specification), specification);
            }
            return(metamodel);
        }