示例#1
0
 public void DomainTest()
 {
     var v = new VariableWrapper( "x", "XX" );
       Assert.That( v.GetIndexDomain(), Is.EqualTo( -42 ) );
       v.Domain = new Domain( -5 );
       Assert.That( v.GetIndexDomain(), Is.EqualTo( -5 ) );
 }
示例#2
0
        public void DomainTest()
        {
            var v = new VariableWrapper("x", "XX");

            Assert.That(v.GetIndexDomain(), Is.EqualTo(-42));
            v.Domain = new Domain(-5);
            Assert.That(v.GetIndexDomain(), Is.EqualTo(-5));
        }
示例#3
0
        public void DomainTest()
        {
            var v = new VariableWrapper("x", "XX");

            Assert.AreEqual(-42, v.GetIndexDomain());
            v.Domain = new Domain(-5);
            Assert.AreEqual(-5, v.GetIndexDomain());
        }
示例#4
0
        public void ConstructorsTest()
        {
            var v1 = new VariableWrapper( "a", "bb" );
              var v2 = new VariableWrapper( "a", "bb" );
              var v3 = new VariableWrapper( "a", "bb" );
              Assert.That( v1.Name, Is.EqualTo( "a" ) );
              Assert.That( v1.FullName, Is.EqualTo( "bb" ) );
              Assert.That( v1.GetValue(), Is.EqualTo( -1 ) );

              v1 = new VariableWrapper( "a", "bb", new Domain( 5, 0 ), 4 );
              v2 = new VariableWrapper( "a", "bb", new Domain( 20, -4 ), -5 );
              v3 = new VariableWrapper( "a", "bb", new Domain( 10, 1 ), -2 );
              Assert.That( v1.GetValue(), Is.EqualTo( 4 ) );
              Assert.That( v2.GetValue(), Is.EqualTo( -5 ) );
              Assert.That( v3.GetValue(), Is.Zero );
        }
示例#5
0
        public void ConstructorsTest()
        {
            var v1 = new VariableWrapper("a", "bb");
            var v2 = new VariableWrapper("a", "bb");
            var v3 = new VariableWrapper("a", "bb");

            Assert.That(v1.Name, Is.EqualTo("a"));
            Assert.That(v1.FullName, Is.EqualTo("bb"));
            Assert.That(v1.GetValue(), Is.EqualTo(-1));

            v1 = new VariableWrapper("a", "bb", new Domain(5, 0), 4);
            v2 = new VariableWrapper("a", "bb", new Domain(20, -4), -5);
            v3 = new VariableWrapper("a", "bb", new Domain(10, 1), -2);
            Assert.That(v1.GetValue(), Is.EqualTo(4));
            Assert.That(v2.GetValue(), Is.EqualTo(-5));
            Assert.That(v3.GetValue(), Is.Zero);
        }
示例#6
0
        public void ConstructorsTest()
        {
            var v1 = new VariableWrapper("a", "bb");
            var v2 = new VariableWrapper("a", "bb");
            var v3 = new VariableWrapper("a", "bb");

            Assert.AreEqual("a", v1.Name);
            Assert.AreEqual("bb", v1.FullName);
            Assert.AreEqual(-1, v1.GetValue());

            v1 = new VariableWrapper("a", "bb", new Domain(5, 0), 4);
            v2 = new VariableWrapper("a", "bb", new Domain(20, -4), -5);
            v3 = new VariableWrapper("a", "bb", new Domain(10, 1), -2);
            Assert.AreEqual(4, v1.GetValue());
            Assert.AreEqual(-5, v2.GetValue());
            Assert.AreEqual(0, v3.GetValue());
        }
示例#7
0
        public void DomainFailTest()
        {
            var v = new VariableWrapper("x", "XX");

            Assert.Throws <ArgumentException>(() => v.Domain = null);
        }
示例#8
0
 public void DomainFailTest()
 {
     var v = new VariableWrapper( "x", "XX" );
       Assert.Throws<ArgumentException>(()=>v.Domain = null);
 }
示例#9
0
        public void DomainFailTest()
        {
            var v = new VariableWrapper("x", "XX");

            v.Domain = null;
        }