Beispiel #1
0
        private static void AssertPropertiesInState(LogNormalDistributionProperties properties, bool meanReadOnly, bool deviationReadOnly)
        {
            PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties);

            Assert.AreEqual(3, dynamicProperties.Count);

            PropertyDescriptor distributionTypeProperty = dynamicProperties[0];

            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(distributionTypeProperty,
                                                                            "Misc",
                                                                            "Type verdeling",
                                                                            "Het soort kansverdeling waarin deze parameter gedefinieerd wordt.",
                                                                            true);

            PropertyDescriptor meanProperty = dynamicProperties[1];

            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(meanProperty,
                                                                            "Misc",
                                                                            "Verwachtingswaarde",
                                                                            "De gemiddelde waarde van de lognormale verdeling.",
                                                                            meanReadOnly);

            PropertyDescriptor standardDeviationProperty = dynamicProperties[2];

            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(standardDeviationProperty,
                                                                            "Misc",
                                                                            "Standaardafwijking",
                                                                            "De standaardafwijking van de lognormale verdeling.",
                                                                            deviationReadOnly);
        }
Beispiel #2
0
        public void Constructor_WithDistribution_ExpectedValues()
        {
            // Setup
            var distribution = new LogNormalDistribution();

            // Call
            var properties = new LogNormalDistributionProperties(distribution);

            // Assert
            Assert.IsInstanceOf <DistributionPropertiesBase <LogNormalDistribution> >(properties);
            Assert.AreSame(distribution, properties.Data);
            Assert.AreEqual("Lognormaal", properties.DistributionType);

            AssertPropertiesInState(properties, true, true);
        }
Beispiel #3
0
        public void Constructor_WithParameters_ExpectedValues()
        {
            // Setup
            var mocks   = new MockRepository();
            var handler = mocks.Stub <IObservablePropertyChangeHandler>();

            mocks.ReplayAll();

            var distribution = new LogNormalDistribution();

            // Call
            var properties = new LogNormalDistributionProperties(
                DistributionReadOnlyProperties.None, distribution, handler);

            // Assert
            Assert.IsInstanceOf <DistributionPropertiesBase <LogNormalDistribution> >(properties);
            Assert.AreSame(distribution, properties.Data);
            Assert.AreEqual("Lognormaal", properties.DistributionType);

            AssertPropertiesInState(properties, false, false);

            mocks.VerifyAll();
        }