コード例 #1
0
        public void GetValuesTest()
        {
            MultipleSeriesStatistics2D <User> statistics2D = new MultipleSeriesStatistics2D <User>("Gender");

            statistics2D.AddSeries("Age");
            statistics2D.AddSeries("Weight");
            var result = statistics2D.GetValues(SetupData());

            Assert.AreEqual(result.Count, 2);
            Assert.AreEqual(result["Age"]["男"], 66);
            Assert.AreEqual(result["Age"]["女"], 101);
            Assert.AreEqual(result["Weight"]["男"], 250);
            Assert.AreEqual(result["Weight"]["女"], 250);
        }
コード例 #2
0
        public void AddSeriesTest()
        {
            MultipleSeriesStatistics2D <User> statistics2D = new MultipleSeriesStatistics2D <User>("Gender");

            statistics2D.AddSeries("Age");

            Assert.AreEqual(statistics2D.SeriesCount, 1);

            try { statistics2D.AddSeries("Age"); }
            catch { }
            Assert.AreEqual(statistics2D.SeriesCount, 1);

            statistics2D.AddSeries("Weight");
            Assert.AreEqual(statistics2D.SeriesCount, 2);
        }