Exemplo n.º 1
0
        public void ShouldCalculateConflict()
        {
            // Setup
            _model.Assign("NSW", new DummyCspValue("R"));
            _model.Assign("Q", new DummyCspValue("R"));

            // Act
            var nConflicts = _model.Conflicts("SA", new DummyCspValue("R"));

            // Verify
            Assert.Equal(2, nConflicts);
            Assert.Equal(3, _model.GetDomain("NSW").Values.Count);
            Assert.Equal(3, _model.GetDomain("Q").Values.Count);
            Assert.Equal(3, _model.GetDomain("SA").Values.Count);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Variable assigment
 /// </summary>
 /// <param name="variableKey">Key</param>
 /// <param name="value">Value</param>
 public Csp <T> AddAssignment(string variableKey, T value)
 {
     _model.Assign(variableKey, value);
     _nAssigns++;
     return(this);
 }