示例#1
0
        public void VerifyThatInlineEditWorkSimpleNoOptionNoState()
        {
            this.subscription = new ParameterSubscription(Guid.NewGuid(), this.assembler.Cache, this.uri);
            this.parameter.IsOptionDependent = false;
            this.parameter.ParameterSubscription.Add(this.subscription);
            this.parameter.StateDependence = null;

            var set1 = new ParameterValueSet(Guid.NewGuid(), this.assembler.Cache, this.uri);

            this.parameter.ValueSet.Add(set1);

            var subset1 = new ParameterSubscriptionValueSet(Guid.NewGuid(), this.assembler.Cache, this.uri)
            {
                SubscribedValueSet = set1
            };

            this.subscription.ValueSet.Add(subset1);

            var row = new ParameterSubscriptionRowViewModel(this.subscription, this.session.Object, null, false);

            Assert.AreEqual(0, row.ContainedRows.Count);

            row.Switch = ParameterSwitchKind.REFERENCE;
            row.CreateCloneAndWrite(ParameterSwitchKind.REFERENCE, "Switch");

            this.session.Verify(x => x.Write(It.Is <OperationContainer>(op => ((CDP4Common.DTO.ParameterSubscriptionValueSet)op.Operations.Single().ModifiedThing).ValueSwitch == ParameterSwitchKind.REFERENCE)));
        }
示例#2
0
        public void VerifyThatParameterSubscriptionHasRightOwnerValue()
        {
            this.parameter5Subscription = new ParameterSubscription(Guid.NewGuid(), this.assembler.Cache, this.uri)
            {
                Owner = this.activeDomain
            };
            this.parameter5ForSubscription.ParameterSubscription.Add(this.parameter5Subscription);

            var valueSet = new ParameterValueSet(Guid.NewGuid(), this.assembler.Cache, this.uri);

            this.SetScalarValueSet(valueSet);

            var valueSetSub = new ParameterSubscriptionValueSet(Guid.NewGuid(), this.assembler.Cache, this.uri);

            valueSetSub.SubscribedValueSet = valueSet;

            this.parameter5Subscription.ValueSet.Add(valueSetSub);

            var row = new ParameterSubscriptionRowViewModel(this.parameter5Subscription, this.session.Object, null, false);

            Assert.AreEqual(0, row.ContainedRows.Count);
            Assert.AreEqual("PTName", row.Name);
            Assert.AreEqual("[other]", row.OwnerName);
            Assert.AreEqual("formula", row.Formula);
            Assert.AreEqual("ref", row.Reference);
            Assert.That(row.ScaleName, Is.Null.Or.Empty);
        }
示例#3
0
        public void VerifyThatUpdateValueSetUpdates(IViewModelBase <Thing> container, string scenario)
        {
            var valueset = new ParameterValueSet(Guid.NewGuid(), this.assembler.Cache, this.uri);

            this.parameter.ValueSet.Add(valueset);

            this.subscription = new ParameterSubscription(Guid.NewGuid(), this.assembler.Cache, this.uri);
            this.parameter.ParameterSubscription.Add(subscription);

            var subscriptionValueSet = new ParameterSubscriptionValueSet(Guid.NewGuid(), this.assembler.Cache, this.uri)
            {
                SubscribedValueSet = valueset
            };

            this.subscription.ValueSet.Add(subscriptionValueSet);

            var row = new ParameterSubscriptionRowViewModel(this.subscription, this.session.Object, container, false);

            var revInfo = typeof(Thing).GetProperty("RevisionNumber");

            revInfo.SetValue(subscriptionValueSet, 10);

            Assert.AreEqual("-", row.Manual);
            subscriptionValueSet.Manual = new ValueArray <string>(new List <string> {
                "test"
            });
            CDPMessageBus.Current.SendObjectChangeEvent(subscriptionValueSet, EventKind.Updated);

            Assert.AreEqual("test", row.Manual);
            row.Dispose();
        }
示例#4
0
        public void VerifyThatValueSetInlineEditWorksCompoundOptionState()
        {
            this.subscription = new ParameterSubscription(Guid.NewGuid(), this.assembler.Cache, this.uri);
            this.cptParameter.ParameterSubscription.Add(subscription);

            this.subscription.ValueSet.Add(new ParameterSubscriptionValueSet(Guid.NewGuid(), this.assembler.Cache, this.uri)
            {
                SubscribedValueSet = this.valueset1
            });
            this.subscription.ValueSet.Add(new ParameterSubscriptionValueSet(Guid.NewGuid(), this.assembler.Cache, this.uri)
            {
                SubscribedValueSet = this.valueset2
            });
            this.subscription.ValueSet.Add(new ParameterSubscriptionValueSet(Guid.NewGuid(), this.assembler.Cache, this.uri)
            {
                SubscribedValueSet = this.valueset3
            });
            this.subscription.ValueSet.Add(new ParameterSubscriptionValueSet(Guid.NewGuid(), this.assembler.Cache, this.uri)
            {
                SubscribedValueSet = this.valueset4
            });

            var row        = new ParameterSubscriptionRowViewModel(this.subscription, this.session.Object, null, false);
            var option1Row =
                row.ContainedRows.OfType <ParameterOptionRowViewModel>().Single(x => x.ActualOption == this.option1);

            var option2Row =
                row.ContainedRows.OfType <ParameterOptionRowViewModel>().Single(x => x.ActualOption == this.option2);

            var o1s1Row = option1Row.ContainedRows.OfType <ParameterStateRowViewModel>()
                          .Single(x => x.ActualState == this.actualState1);
            var o1s2Row = option1Row.ContainedRows.OfType <ParameterStateRowViewModel>()
                          .Single(x => x.ActualState == this.actualState2);
            var o2s1Row = option2Row.ContainedRows.OfType <ParameterStateRowViewModel>()
                          .Single(x => x.ActualState == this.actualState1);
            var o2s2Row = option2Row.ContainedRows.OfType <ParameterStateRowViewModel>()
                          .Single(x => x.ActualState == this.actualState2);

            var o1s1c1Row = o1s1Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().First();
            var o1s1c2Row = o1s1Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().Last();
            var o1s2c1Row = o1s2Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().First();
            var o1s2c2Row = o1s2Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().Last();
            var o2s1c1Row = o2s1Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().First();
            var o2s1c2Row = o2s1Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().Last();
            var o2s2c1Row = o2s2Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().First();
            var o2s2c2Row = o2s2Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().Last();

            o1s1c1Row.Switch = ParameterSwitchKind.REFERENCE;
            o1s1c1Row.CreateCloneAndWrite(ParameterSwitchKind.REFERENCE, "Switch");

            this.session.Verify(x => x.Write(It.Is <OperationContainer>(op => ((CDP4Common.DTO.ParameterSubscriptionValueSet)op.Operations.Single().ModifiedThing).ValueSwitch == ParameterSwitchKind.REFERENCE)));
        }
示例#5
0
        public void VerifyThatComputedAndReferenceValueAreUpdated(IViewModelBase <Thing> container, string scenario)
        {
            this.subscription = new ParameterSubscription(Guid.NewGuid(), this.assembler.Cache, this.uri);
            this.parameter.IsOptionDependent = false;
            this.parameter.ParameterSubscription.Add(this.subscription);
            this.parameter.StateDependence = null;

            var set1       = new ParameterValueSet(Guid.NewGuid(), this.assembler.Cache, this.uri);
            var liststring = new List <string> {
                "abc"
            };

            set1.Reference = new ValueArray <string>(liststring);
            set1.Published = new ValueArray <string>(liststring);

            this.parameter.ValueSet.Add(set1);

            var subset1 = new ParameterSubscriptionValueSet(Guid.NewGuid(), this.assembler.Cache, this.uri)
            {
                SubscribedValueSet = set1
            };

            this.subscription.ValueSet.Add(subset1);

            var row = new ParameterSubscriptionRowViewModel(this.subscription, this.session.Object, container, false);

            Assert.AreEqual("abc", row.Computed);
            Assert.AreEqual("abc", row.Reference);

            var updated = new List <string> {
                "123"
            };

            set1.Published = new ValueArray <string>(updated);
            set1.Reference = new ValueArray <string>(updated);

            var rev = typeof(Thing).GetProperty("RevisionNumber");

            rev.SetValue(set1, 50);

            CDPMessageBus.Current.SendObjectChangeEvent(set1, EventKind.Updated);
            Assert.AreEqual("123", row.Computed);
            Assert.AreEqual("123", row.Reference);
        }
        public void VerifyThatRowsAreInsertedCorrectly()
        {
            var list     = new ReactiveList <IRowViewModelBase <Thing> >();
            var comparer = new ParameterGroupChildRowComparer();

            var parameter1 = new Parameter(Guid.NewGuid(), null, this.uri)
            {
                ParameterType = this.type, Owner = this.domain, Container = this.elementDef
            };

            parameter1.ValueSet.Add(this.valueSet);

            var subscription = new ParameterSubscription(Guid.NewGuid(), null, this.uri);

            parameter1.ParameterSubscription.Add(subscription);

            var parameterRow1 = new ParameterRowViewModel(parameter1, this.session.Object, null, false);

            var group1 = new ParameterGroup(Guid.NewGuid(), null, this.uri)
            {
                Name = "a"
            };
            var groupRow1 = new ParameterGroupRowViewModel(group1, this.domain, this.session.Object, null);

            var group2 = new ParameterGroup(Guid.NewGuid(), null, this.uri)
            {
                Name = "b"
            };
            var groupRow2 = new ParameterGroupRowViewModel(group2, this.domain, this.session.Object, null);

            var subscriptionRow = new ParameterSubscriptionRowViewModel(subscription, this.session.Object, null, false);

            list.SortedInsert(parameterRow1, comparer);
            list.SortedInsert(groupRow1, comparer);
            list.SortedInsert(groupRow2, comparer);
            list.SortedInsert(subscriptionRow, comparer);

            Assert.AreSame(subscriptionRow, list[0]);
            Assert.AreSame(parameterRow1, list[1]);
            Assert.AreSame(groupRow1, list[2]);
            Assert.AreSame(groupRow2, list[3]);
        }
        public void VerifyThatOwnerIsUpdated(IViewModelBase <Thing> container, string scenario)
        {
            var parameter = new Parameter(Guid.NewGuid(), this.cache, this.uri);

            parameter.Owner = this.activeDomain;
            var boolPt = new BooleanParameterType(Guid.NewGuid(), this.cache, this.uri);
            var compoundParameterType = new CompoundParameterType(Guid.NewGuid(), this.cache, this.uri);
            var component1            = new ParameterTypeComponent(Guid.NewGuid(), this.cache, this.uri)
            {
                ParameterType = boolPt
            };
            var component2 = new ParameterTypeComponent(Guid.NewGuid(), this.cache, this.uri)
            {
                ParameterType = boolPt
            };

            compoundParameterType.Component.Add(component1);
            compoundParameterType.Component.Add(component2);
            parameter.ParameterType = compoundParameterType;
            this.elementDefinition.Parameter.Add(parameter);

            var parameterSubscription = new ParameterSubscription(Guid.NewGuid(), this.cache, this.uri);

            parameterSubscription.Owner = this.otherDomain;

            parameter.ParameterSubscription.Add(parameterSubscription);

            var parameterSubscriptionRowViewModel = new ParameterSubscriptionRowViewModel(parameterSubscription, this.session.Object, container, false);

            var component1row = (ParameterComponentValueRowViewModel)parameterSubscriptionRowViewModel.ContainedRows.First();

            Assert.IsTrue(component1row.OwnerName.Contains(this.activeDomain.Name));

            this.activeDomain.Name           = "updated";
            this.activeDomain.RevisionNumber = 100;
            CDPMessageBus.Current.SendObjectChangeEvent(this.activeDomain, EventKind.Updated);

            Assert.IsTrue(component1row.OwnerName.Contains("updated"));
        }
        public void VerifyThatValidatePropertyWorks()
        {
            var parameter = new Parameter(Guid.NewGuid(), this.cache, this.uri);

            parameter.Owner = this.activeDomain;
            var boolPt = new BooleanParameterType(Guid.NewGuid(), this.cache, this.uri);
            var compoundParameterType = new CompoundParameterType(Guid.NewGuid(), this.cache, this.uri);
            var component1            = new ParameterTypeComponent(Guid.NewGuid(), this.cache, this.uri)
            {
                ParameterType = boolPt
            };
            var component2 = new ParameterTypeComponent(Guid.NewGuid(), this.cache, this.uri)
            {
                ParameterType = boolPt
            };

            compoundParameterType.Component.Add(component1);
            compoundParameterType.Component.Add(component2);
            parameter.ParameterType = compoundParameterType;
            this.elementDefinition.Parameter.Add(parameter);

            var parameterSubscription = new ParameterSubscription(Guid.NewGuid(), this.cache, this.uri);

            parameterSubscription.Owner = this.otherDomain;

            parameter.ParameterSubscription.Add(parameterSubscription);

            var parameterSubscriptionRowViewModel = new ParameterSubscriptionRowViewModel(parameterSubscription, this.session.Object, null, false);

            var component1row = (ParameterComponentValueRowViewModel)parameterSubscriptionRowViewModel.ContainedRows.First();

            Assert.That(component1row.ValidateProperty("Manual", "123"), Is.Not.Null.Or.Empty);
            Assert.That(component1row.ValidateProperty("Reference", "123"), Is.Not.Null.Or.Empty);

            Assert.That(component1row.ValidateProperty("Manual", false), Is.Null.Or.Empty);
            Assert.That(component1row.ValidateProperty("Reference", null), Is.Null.Or.Empty);
        }
示例#9
0
        public void VerifyThatTheSwitchIsUpdatedWhenContainerRowIsAParameterSubscriptionRowViewModel()
        {
            var parameter = new Parameter(Guid.NewGuid(), this.cache, this.uri);

            parameter.Owner = this.activeDomain;
            var boolPt = new BooleanParameterType(Guid.NewGuid(), this.cache, this.uri);
            var compoundParameterType = new CompoundParameterType(Guid.NewGuid(), this.cache, this.uri);
            var component1            = new ParameterTypeComponent(Guid.NewGuid(), this.cache, this.uri)
            {
                ParameterType = boolPt
            };
            var component2 = new ParameterTypeComponent(Guid.NewGuid(), this.cache, this.uri)
            {
                ParameterType = boolPt
            };

            compoundParameterType.Component.Add(component1);
            compoundParameterType.Component.Add(component2);
            parameter.ParameterType = compoundParameterType;
            this.elementDefinition.Parameter.Add(parameter);

            var parameterSubscription = new ParameterSubscription(Guid.NewGuid(), this.cache, this.uri);

            parameterSubscription.Owner = this.otherDomain;

            parameter.ParameterSubscription.Add(parameterSubscription);

            var parameterSubscriptionRowViewModel = new ParameterSubscriptionRowViewModel(parameterSubscription, this.session.Object, null);

            var component1row = (ParameterComponentValueRowViewModel)parameterSubscriptionRowViewModel.ContainedRows.First();
            var component2row = (ParameterComponentValueRowViewModel)parameterSubscriptionRowViewModel.ContainedRows.Last();

            component1row.Switch = ParameterSwitchKind.COMPUTED;

            Assert.AreEqual(ParameterSwitchKind.COMPUTED, component2row.Switch);
        }
        public void VerifyThatRowIsBuiltCorrectlyCompoundNoOptionWithState()
        {
            this.cptParameter.IsOptionDependent = false;

            this.cptParameter.ValueSet.Clear();
            this.valueset1.ActualOption = null;
            this.valueset2.ActualOption = null;
            this.cptParameter.ValueSet.Add(this.valueset1);
            this.cptParameter.ValueSet.Add(this.valueset2);

            this.subscription = new ParameterSubscription(Guid.NewGuid(), null, this.uri);
            this.cptParameter.ParameterSubscription.Add(subscription);

            this.subscription.ValueSet.Add(new ParameterSubscriptionValueSet(Guid.NewGuid(), null, this.uri)
            {
                SubscribedValueSet = this.valueset1
            });
            this.subscription.ValueSet.Add(new ParameterSubscriptionValueSet(Guid.NewGuid(), null, this.uri)
            {
                SubscribedValueSet = this.valueset2
            });

            var row   = new ParameterSubscriptionRowViewModel(this.subscription, this.session.Object, null);
            var s1Row =
                row.ContainedRows.OfType <ParameterStateRowViewModel>().Single(x => x.ActualState == this.actualState1);

            var s2Row =
                row.ContainedRows.OfType <ParameterStateRowViewModel>().Single(x => x.ActualState == this.actualState2);

            var s1c1Row = s1Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().First();
            var s1c2Row = s1Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().Last();
            var s2c1Row = s2Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().First();
            var s2c2Row = s2Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().Last();

            // state row
            Assert.IsFalse(s1Row.IsEditable());
            Assert.IsFalse(s1Row.IsEditable());

            // component row
            Assert.IsTrue(s1c1Row.IsEditable());
            Assert.IsTrue(s1c2Row.IsEditable());
            Assert.IsTrue(s2c1Row.IsEditable());
            Assert.IsTrue(s2c2Row.IsEditable());

            s1c1Row.Switch = ParameterSwitchKind.MANUAL;
            s1c2Row.Switch = ParameterSwitchKind.MANUAL;
            s2c1Row.Switch = ParameterSwitchKind.MANUAL;
            s2c2Row.Switch = ParameterSwitchKind.MANUAL;

            s1c2Row.Manual = new ReactiveList <EnumerationValueDefinition> {
                this.enum1
            };
            s2c2Row.Manual = new ReactiveList <EnumerationValueDefinition> {
                this.enum2
            };

            var s1Set = this.subscription.ValueSet.Single(x => x.ActualState == this.actualState1);
            var s2Set = this.subscription.ValueSet.Single(x => x.ActualState == this.actualState2);

            row.UpdateValueSets(this.subscription);

            Assert.AreEqual(s1Set.ValueSwitch, s1c1Row.Switch);
            Assert.AreEqual(s2Set.ValueSwitch, s2c2Row.Switch);

            Assert.AreEqual(s1Set.Manual[0], s1c1Row.Manual);
            Assert.AreEqual(s2Set.Manual[0], s2c1Row.Manual);

            Assert.AreEqual(s1Set.Manual[1], ValueSetConverter.ToValueSetString(s1c2Row.Manual, s1c2Row.ParameterType));
            Assert.AreEqual(s2Set.Manual[1], ValueSetConverter.ToValueSetString(s2c2Row.Manual, s2c2Row.ParameterType));
        }
        public void VerifyThatRowIsBuiltCorrectlyCompoundOptionNoState()
        {
            this.cptParameter.StateDependence = null;

            this.cptParameter.ValueSet.Clear();
            this.valueset1.ActualState = null;
            this.valueset3.ActualState = null;
            this.cptParameter.ValueSet.Add(this.valueset1);
            this.cptParameter.ValueSet.Add(this.valueset3);

            this.subscription = new ParameterSubscription(Guid.NewGuid(), null, this.uri);
            this.cptParameter.ParameterSubscription.Add(subscription);

            this.subscription.ValueSet.Add(new ParameterSubscriptionValueSet(Guid.NewGuid(), null, this.uri)
            {
                SubscribedValueSet = this.valueset1
            });
            this.subscription.ValueSet.Add(new ParameterSubscriptionValueSet(Guid.NewGuid(), null, this.uri)
            {
                SubscribedValueSet = this.valueset3
            });

            var row        = new ParameterSubscriptionRowViewModel(this.subscription, this.session.Object, null);
            var option1Row = row.ContainedRows.OfType <ParameterOptionRowViewModel>().Single(x => x.ActualOption == this.option1);
            var option2Row = row.ContainedRows.OfType <ParameterOptionRowViewModel>().Single(x => x.ActualOption == this.option2);

            var o1c1Row = option1Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().First();
            var o1c2Row = option1Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().Last();
            var o2c1Row = option2Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().First();
            var o2c2Row = option2Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().Last();

            // option row
            Assert.IsFalse(option1Row.IsEditable());
            Assert.IsFalse(option1Row.IsEditable());

            // component row
            Assert.IsTrue(o1c1Row.IsEditable());
            Assert.IsTrue(o1c2Row.IsEditable());
            Assert.IsTrue(o2c1Row.IsEditable());
            Assert.IsTrue(o2c2Row.IsEditable());

            o1c1Row.Switch = ParameterSwitchKind.MANUAL;
            o1c2Row.Switch = ParameterSwitchKind.MANUAL;
            o2c1Row.Switch = ParameterSwitchKind.MANUAL;
            o2c2Row.Switch = ParameterSwitchKind.MANUAL;

            o1c2Row.Manual = new ReactiveList <EnumerationValueDefinition> {
                this.enum1
            };
            o2c2Row.Manual = new ReactiveList <EnumerationValueDefinition> {
                this.enum2
            };

            var o1Set = this.subscription.ValueSet.Single(x => x.ActualOption == this.option1);
            var o2Set = this.subscription.ValueSet.Single(x => x.ActualOption == this.option2);

            row.UpdateValueSets(this.subscription);

            Assert.AreEqual(o1Set.ValueSwitch, o1c1Row.Switch);
            Assert.AreEqual(o2Set.ValueSwitch, o2c2Row.Switch);

            Assert.AreEqual(o1Set.Manual[0], o1c1Row.Manual);
            Assert.AreEqual(o2Set.Manual[0], o2c1Row.Manual);

            Assert.AreEqual(o1Set.Manual[1], ValueSetConverter.ToValueSetString(o1c2Row.Manual, o1c2Row.ParameterType));
            Assert.AreEqual(o2Set.Manual[1], ValueSetConverter.ToValueSetString(o2c2Row.Manual, o2c2Row.ParameterType));
        }
        public void VerifyThatUpdateValueSetWorksCompoundOptionState()
        {
            this.subscription = new ParameterSubscription(Guid.NewGuid(), null, this.uri);
            this.cptParameter.ParameterSubscription.Add(subscription);

            this.subscription.ValueSet.Add(new ParameterSubscriptionValueSet(Guid.NewGuid(), null, this.uri)
            {
                SubscribedValueSet = this.valueset1
            });
            this.subscription.ValueSet.Add(new ParameterSubscriptionValueSet(Guid.NewGuid(), null, this.uri)
            {
                SubscribedValueSet = this.valueset2
            });
            this.subscription.ValueSet.Add(new ParameterSubscriptionValueSet(Guid.NewGuid(), null, this.uri)
            {
                SubscribedValueSet = this.valueset3
            });
            this.subscription.ValueSet.Add(new ParameterSubscriptionValueSet(Guid.NewGuid(), null, this.uri)
            {
                SubscribedValueSet = this.valueset4
            });

            var row        = new ParameterSubscriptionRowViewModel(this.subscription, this.session.Object, null);
            var option1Row =
                row.ContainedRows.OfType <ParameterOptionRowViewModel>().Single(x => x.ActualOption == this.option1);

            var option2Row =
                row.ContainedRows.OfType <ParameterOptionRowViewModel>().Single(x => x.ActualOption == this.option2);

            var o1s1Row = option1Row.ContainedRows.OfType <ParameterStateRowViewModel>()
                          .Single(x => x.ActualState == this.actualState1);
            var o1s2Row = option1Row.ContainedRows.OfType <ParameterStateRowViewModel>()
                          .Single(x => x.ActualState == this.actualState2);
            var o2s1Row = option2Row.ContainedRows.OfType <ParameterStateRowViewModel>()
                          .Single(x => x.ActualState == this.actualState1);
            var o2s2Row = option2Row.ContainedRows.OfType <ParameterStateRowViewModel>()
                          .Single(x => x.ActualState == this.actualState2);

            var o1s1c1Row = o1s1Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().First();
            var o1s1c2Row = o1s1Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().Last();
            var o1s2c1Row = o1s2Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().First();
            var o1s2c2Row = o1s2Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().Last();
            var o2s1c1Row = o2s1Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().First();
            var o2s1c2Row = o2s1Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().Last();
            var o2s2c1Row = o2s2Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().First();
            var o2s2c2Row = o2s2Row.ContainedRows.OfType <ParameterComponentValueRowViewModel>().Last();

            // option row
            Assert.IsFalse(option1Row.IsEditable());
            Assert.IsFalse(option2Row.IsEditable());

            // state row
            Assert.IsFalse(o1s1Row.IsEditable());
            Assert.IsFalse(o1s2Row.IsEditable());
            Assert.IsFalse(o2s1Row.IsEditable());
            Assert.IsFalse(o2s2Row.IsEditable());

            // component row
            Assert.IsTrue(o1s1c1Row.IsEditable());
            Assert.IsTrue(o1s2c1Row.IsEditable());
            Assert.IsTrue(o2s1c1Row.IsEditable());
            Assert.IsTrue(o2s2c1Row.IsEditable());

            o1s1c1Row.Switch = ParameterSwitchKind.REFERENCE;
            o1s1c2Row.Switch = ParameterSwitchKind.REFERENCE;
            o1s2c1Row.Switch = ParameterSwitchKind.REFERENCE;
            o1s2c2Row.Switch = ParameterSwitchKind.REFERENCE;
            o2s1c1Row.Switch = ParameterSwitchKind.REFERENCE;
            o2s1c2Row.Switch = ParameterSwitchKind.REFERENCE;
            o2s2c1Row.Switch = ParameterSwitchKind.REFERENCE;
            o2s2c2Row.Switch = ParameterSwitchKind.REFERENCE;

            o1s1c2Row.Manual = new ReactiveList <EnumerationValueDefinition> {
                this.enum1
            };
            o1s2c2Row.Manual = new ReactiveList <EnumerationValueDefinition> {
                this.enum1
            };
            o2s1c2Row.Manual = new ReactiveList <EnumerationValueDefinition> {
                this.enum2
            };
            o2s2c2Row.Manual = new ReactiveList <EnumerationValueDefinition> {
                this.enum2
            };

            var o1s1Set = this.subscription.ValueSet.Single(x => x.ActualOption == this.option1 && x.ActualState == this.actualState1);
            var o1s2Set = this.subscription.ValueSet.Single(x => x.ActualOption == this.option1 && x.ActualState == this.actualState2);
            var o2s1Set = this.subscription.ValueSet.Single(x => x.ActualOption == this.option2 && x.ActualState == this.actualState1);
            var o2s2Set = this.subscription.ValueSet.Single(x => x.ActualOption == this.option2 && x.ActualState == this.actualState2);

            row.UpdateValueSets(this.subscription);

            Assert.AreEqual(o1s1Set.ValueSwitch, o1s1c1Row.Switch);
            Assert.AreEqual(o1s2Set.ValueSwitch, o1s2c1Row.Switch);
            Assert.AreEqual(o2s1Set.ValueSwitch, o2s1c1Row.Switch);
            Assert.AreEqual(o2s2Set.ValueSwitch, o2s2c1Row.Switch);

            Assert.AreEqual(o1s1Set.Manual[0], o1s1c1Row.Manual);
            Assert.AreEqual(o1s2Set.Manual[0], o1s2c1Row.Manual);
            Assert.AreEqual(o2s1Set.Manual[0], o2s1c1Row.Manual);
            Assert.AreEqual(o2s2Set.Manual[0], o2s2c1Row.Manual);

            Assert.AreEqual(o1s1Set.Manual[1], ValueSetConverter.ToValueSetString(o1s1c2Row.Manual, o1s1c2Row.ParameterType));
            Assert.AreEqual(o1s2Set.Manual[1], ValueSetConverter.ToValueSetString(o1s2c2Row.Manual, o1s2c2Row.ParameterType));
            Assert.AreEqual(o2s1Set.Manual[1], ValueSetConverter.ToValueSetString(o2s1c2Row.Manual, o2s1c2Row.ParameterType));
            Assert.AreEqual(o2s2Set.Manual[1], ValueSetConverter.ToValueSetString(o2s2c2Row.Manual, o2s2c2Row.ParameterType));
        }