Ejemplo n.º 1
0
        void ValueProperty <TValue>(Object input1, TValue input2, TValue newValue, TValue value, Boolean hasChanged)
        {
            ITrackedProperty <Object, TValue> prop = new TrackedProperty <Object, TValue>(input1, input2);

            Test.IfNot.Action.ThrowsException(() => prop.Value = newValue, out Exception ex);
            Test.If.Value.IsEqual(prop.Value, value);
            Test.If.Value.IsEqual(prop.HasValueChanged, hasChanged);
        }
Ejemplo n.º 2
0
        void FullConstructor(Object input1, Int32 input2, Int32 value, Boolean hasChanged)
        {
            ITrackedProperty <Object, Int32> prop = null;

            Test.IfNot.Action.ThrowsException(() => prop = new TrackedProperty <Object, Int32>(input1, input2), out Exception ex);

            Test.IfNot.Object.IsNull(prop);
            Test.If.Value.IsEqual(prop.Value, value);
            Test.If.Value.IsEqual(prop.HasValueChanged, hasChanged);
        }
Ejemplo n.º 3
0
        void PropertyChangedEvent <TValue>(Object input1, TValue input2, Boolean raises, TValue newValue, String propertyName)
        {
            ITrackedProperty <Object, TValue> prop = new TrackedProperty <Object, TValue>(input1, input2);

            if (raises)
            {
                Test.If.Action.RaisesPropertyChangedEvent(() => prop.Value = newValue, prop, out EventData <PropertyChangedEventArgs> eventData);

                Test.If.Reference.IsEqual(eventData.Sender, prop);
                Test.IfNot.Object.IsNull(eventData.EventArgs);
                Test.If.Value.IsEqual(eventData.EventArgs.PropertyName, propertyName);
            }
            else
            {
                Test.IfNot.Action.RaisesPropertyChangedEvent(() => prop.Value = newValue, prop, out EventData <PropertyChangedEventArgs> eventData);
            }
        }
Ejemplo n.º 4
0
        void ChangeTrackedEvent <TValue>(Object input1, TValue input2, Boolean raises, TValue newValue, Object owner, TValue old, TValue _new, Boolean hasChanged)
        {
            ITrackedProperty <Object, TValue> prop = new TrackedProperty <Object, TValue>(input1, input2);

            if (raises)
            {
                Test.If.Action.RaisesEvent(() => prop.Value = newValue, prop, "ChangeTracked", out EventData <ChangeTrackedEventArgs <Object, TValue> > eventData);

                Test.If.Value.IsEqual(eventData.Sender, prop);
                Test.If.Value.IsEqual(eventData.EventArgs.Owner, owner);
                Test.If.Value.IsEqual(eventData.EventArgs.Old, old);
                Test.If.Value.IsEqual(eventData.EventArgs.New, _new);
                Test.If.Value.IsEqual(eventData.EventArgs.HasChanged, hasChanged);
            }
            else
            {
                Test.IfNot.Action.RaisesEvent(() => prop.Value = newValue, prop, "ChangeTracked", out EventData <ChangeTrackedEventArgs <Object, TValue> > eventData);
            }
        }