A binding between a variable and its value in a particular context
示例#1
0
 protected override void When()
 {
     _binding = new VariableBinding(_variable, _value);
 }
示例#2
0
        /// <summary>
        /// Sets the value of the specified variable
        /// </summary>
        /// <param name="variable">The variable for which to set the specified value</param>
        /// <param name="value">The new value of the specified variable</param>
        public void SetVariableValue(Variable variable, object value)
        {
            Contract.Requires(variable != null);

            var binding = TryGetBinding(variable);

            if(binding != null)
            {
                binding.Value = value;
            }
            else
            {
                binding = new VariableBinding(variable, value);

                _bindingsByVariable[variable] = binding;
            }
        }