Beispiel #1
0
        public void ValidateSufficientStatisticsTryParse()
        {
            SufficientStatistics result        = null;
            SufficientStatistics continousStat = SufficientStatistics.Parse("1");

            Assert.IsTrue(SufficientStatistics.TryParse("1.25658", out result));
            Assert.IsFalse(continousStat.Equals(result));
        }
        public void ValidateStatisticsListGetInstance()
        {
            GaussianStatistics gaussStat    = GaussianStatistics.GetInstance(2.33, 1.256, 7);
            DiscreteStatistics discreteStat = DiscreteStatistics.GetInstance(1);
            StatisticsList     statList     = StatisticsList.GetInstance(gaussStat);

            statList.Add(discreteStat);
            SufficientStatistics result = null;

            foreach (SufficientStatistics stat in statList)
            {
                Assert.IsTrue(SufficientStatistics.TryParse(stat.ToString(), out result));
            }
        }
        public void ValidateStatisticsListAdd()
        {
            StatisticsList       statList     = new StatisticsList();
            GaussianStatistics   gaussStat    = GaussianStatistics.GetInstance(2.33, 1.256, 7);
            DiscreteStatistics   discreteStat = DiscreteStatistics.GetInstance(1);
            ContinuousStatistics contStat     = ContinuousStatistics.GetInstance(2.333);
            MissingStatistics    missingStat  = MissingStatistics.GetInstance;
            BooleanStatistics    boolStat     = BooleanStatistics.GetInstance(true);

            statList.Add(gaussStat);
            statList.Add(discreteStat);
            statList.Add(contStat);
            statList.Add(missingStat);
            statList.Add(boolStat);
            Assert.AreEqual(5, statList.Count);
            SufficientStatistics result = null;

            foreach (SufficientStatistics stat in statList)
            {
                Assert.IsTrue(SufficientStatistics.TryParse(stat.ToString(), out result));
            }
        }