Exemplo n.º 1
0
 public void should_return_true_if_they_have_the_same_method_source_description_and_false_otherwise(ValueOriginSourceId source, ValueOriginDeterminationMethodId method, string description, bool equal)
 {
     _targetValueOrigin.Source      = ValueOriginSources.ById(source);
     _targetValueOrigin.Method      = ValueOriginDeterminationMethods.ById(method);
     _targetValueOrigin.Description = description;
     _sourceValueOrigin.Equals(_targetValueOrigin).ShouldBeEqualTo(equal);
 }
 public ValueOrigin MapFrom(FlatValueOrigin flatValueOrigin)
 {
     return(new ValueOrigin
     {
         Id = flatValueOrigin.Id,
         Description = flatValueOrigin.Description,
         Source = ValueOriginSources.ById(flatValueOrigin.Source),
         Method = ValueOriginDeterminationMethods.ById(flatValueOrigin.Method),
     });
 }
Exemplo n.º 3
0
        public virtual void UpdateValueOrigin(ModelValueOrigin valueOrigin, SnapshotValueOrigin snapshot)
        {
            if (snapshot == null)
            {
                return;
            }

            var snapshotValueOrigin = new ModelValueOrigin
            {
                Id          = snapshot.Id,
                Source      = ValueOriginSources.ById(ModelValueFor(snapshot.Source, ValueOriginSourceId.Undefined)),
                Method      = ValueOriginDeterminationMethods.ById(ModelValueFor(snapshot.Method, ValueOriginDeterminationMethodId.Undefined)),
                Description = ModelValueFor(snapshot.Description),
            };

            valueOrigin.UpdateAllFrom(snapshotValueOrigin);
        }
Exemplo n.º 4
0
 public override object ConvertFrom(string attributeValue, TSerializationContext context)
 {
     return(ValueOriginSources.ById(EnumHelper.ParseValue <ValueOriginSourceId>(attributeValue)));
 }