Ejemplo n.º 1
0
        public void MinimumValueShouldBeSetToDoubleMinimumWhenNumericFieldIsNotUsedAsNumberOfSamples() {
            var vm = new NumericFieldViewModel();
            var editableRoot = new NumericFieldTestStub {Sample_f_SampleSettings = @"<SampleSettings SampleSizeFieldName=""NumberOfSamples_f"" />"};
            var detailsModelMock = Mock.Create<IDetailsViewModel>();
            vm.Property = typeof(NumericFieldTestStub).GetPropertyByName("JustANumber_f");
            vm.Init(editableRoot, null, detailsModelMock);

            Assert.AreEqual(double.MinValue, vm.MinimumValue);
        }
Ejemplo n.º 2
0
        public void MinimumValueShouldBeSetToMinimumValueWhenNumericFieldIsUsedAsNumberOfSamplesButSampleSettingsAreEmpty() {
            var vm = new NumericFieldViewModel();
            var editableRoot = new NumericFieldTestStub();
            var detailsModelMock = Mock.Create<IDetailsViewModel>();
            vm.Property = typeof(NumericFieldTestStub).GetPropertyByName("NumberOfSamples_f");
            vm.Init(editableRoot, null, detailsModelMock);

            Assert.AreEqual(double.MinValue, vm.MinimumValue);
        }