public void ResizeAggregateToSmallerSizeAllVariablesNotNull()
        {
            var sut = new AggregateVariableModel(new WorkspaceModel().Model, new ModelName("x"));

            sut.Resize(10);
            sut.Resize(5);
            Assert.That(sut.Variables, Is.All.InstanceOf <VariableModel>());
        }
        public void ResizeAggregateWithTenSetsNewSize()
        {
            var sut = new AggregateVariableModel(new WorkspaceModel().Model, new ModelName("x"));

            sut.Resize(10);
            Assert.That(sut.AggregateCount, Is.EqualTo(10));
        }
        public void ChangeDomainOfAggregatedVariableWithValueOutsideAggregateDomainX()
        {
            var sut = new AggregateVariableModel(new WorkspaceModel().Model, new ModelName("A test"), 1, new InlineDomainModel("1..10"));

            sut.Resize(10);
            Assert.Throws <ArgumentOutOfRangeException>(() => sut.OverrideDomainTo(10, new VariableDomainExpressionModel("8..10")));
        }
        public void ChangeDomainOfAggregatedVariableWithValueInsideAggregateDomain()
        {
            var sut = new AggregateVariableModel(new WorkspaceModel().Model, new ModelName("A test"), 10, new InlineDomainModel("1..10"));

            sut.Resize(10);
            sut.OverrideDomainTo(9, new VariableDomainExpressionModel("1..5"));
            var actualVariable = sut.GetVariableByIndex(9);

            Assert.That(actualVariable.DomainExpression.Text, Is.EqualTo("1..5"));
        }
        public void ResizeAggregateWithZeroThrowsArgumentOutOfRangeException()
        {
            var sut = new AggregateVariableModel(new WorkspaceModel().Model, new ModelName("x"));

            Assert.Throws <ArgumentOutOfRangeException>(() => sut.Resize(0));
        }