public override void Process(IReflector reflector, Type type, IMethodRemover methodRemover, ISpecificationBuilder specification) { if (DateTimeValueSemanticsProvider.IsAdaptedType(type)) { var spec = reflector.LoadSpecification <IObjectSpecImmutable>(DateTimeValueSemanticsProvider.AdaptedType); AddValueFacets(new DateTimeValueSemanticsProvider(spec, specification), specification); } }
public override void SetUp() { base.SetUp(); holder = new Mock <ISpecification>().Object; var spec = new Mock <IObjectSpecImmutable>().Object; SetValue(adapter = new DateTimeValueSemanticsProvider(spec, holder)); }
public override IImmutableDictionary <string, ITypeSpecBuilder> Process(IReflector reflector, Type type, IMethodRemover methodRemover, ISpecificationBuilder specification, IImmutableDictionary <string, ITypeSpecBuilder> metamodel) { if (!DateTimeValueSemanticsProvider.IsAdaptedType(type)) { return(metamodel); } var(oSpec, mm) = reflector.LoadSpecification <IObjectSpecImmutable>(DateTimeValueSemanticsProvider.AdaptedType, metamodel); AddValueFacets(new DateTimeValueSemanticsProvider(oSpec, specification), specification); return(mm); }
public override ImmutableDictionary <string, ITypeSpecBuilder> Process(IReflector reflector, Type type, IMethodRemover methodRemover, ISpecificationBuilder specification, ImmutableDictionary <string, ITypeSpecBuilder> metamodel) { if (DateTimeValueSemanticsProvider.IsAdaptedType(type)) { var result = reflector.LoadSpecification(DateTimeValueSemanticsProvider.AdaptedType, metamodel); metamodel = result.Item2; var spec = result.Item1 as IObjectSpecImmutable; AddValueFacets(new DateTimeValueSemanticsProvider(spec, specification), specification); } return(metamodel); }