Esempio n. 1
0
        public void VerifyThatPopulatePossibleScalesWorks()
        {
            this.session.Setup(x => x.RetrieveSiteDirectory()).Returns(this.siteDir);
            this.session.Setup(x => x.ActivePerson).Returns(new Person(Guid.NewGuid(), null, this.uri));

            var pt = new SimpleQuantityKind(Guid.NewGuid(), null, this.uri)
            {
                ShortName = "test"
            };

            this.mrdl.ParameterType.Add(pt);

            var scale = new RatioScale(Guid.NewGuid(), null, this.uri)
            {
                ShortName = "testms"
            };

            this.mrdl.Scale.Add(scale);
            pt.PossibleScale.Add(scale);

            var vm = new RequirementsContainerParameterValueDialogViewModel(this.parameterValue.Clone(false), this.thingTransaction,
                                                                            this.session.Object, true, ThingDialogKind.Update, this.thingDialogNavigationService.Object, this.clone);

            vm.SelectedParameterType = pt;

            Assert.AreEqual(0, vm.PossibleScale.Count);
        }
Esempio n. 2
0
        public void VerifyThatPopulatePossibleParameterTypesWorks()
        {
            this.session.Setup(x => x.RetrieveSiteDirectory()).Returns(this.siteDir);
            this.session.Setup(x => x.ActivePerson).Returns(new Person(Guid.NewGuid(), null, this.uri));

            var vm = new RequirementsContainerParameterValueDialogViewModel(this.parameterValue.Clone(false), this.thingTransaction, this.session.Object, true, ThingDialogKind.Update, this.thingDialogNavigationService.Object, this.clone);

            Assert.AreEqual(1, vm.PossibleParameterType.Count);
        }
Esempio n. 3
0
        public void VerifyThatTheExecuteCreateValueCommandAddsANewRow()
        {
            this.session.Setup(x => x.RetrieveSiteDirectory()).Returns(this.siteDir);
            this.session.Setup(x => x.ActivePerson).Returns(new Person(Guid.NewGuid(), null, this.uri));
            this.mrdl.ParameterType.Add(new SimpleQuantityKind(Guid.NewGuid(), null, this.uri)
            {
                ShortName = "test"
            });

            var vm = new RequirementsContainerParameterValueDialogViewModel(this.parameterValue.Clone(false), this.thingTransaction, this.session.Object, true, ThingDialogKind.Update, this.thingDialogNavigationService.Object, this.clone);

            Assert.IsNull(vm.SelectedValue);
        }