コード例 #1
0
ファイル: WaterfallCommandTests.cs プロジェクト: mckaren/pete
        public void ApplyToDataBuildsWaterfallStructure()
        {
            WaterfallCommand cmd  = new WaterfallCommand();
            DataElement      data = GetData();

            cmd.ApplyToData(data);
            Assert.AreEqual("77.24887193", data.Columns[0].Data[5].ToString());
            Assert.AreEqual("77.24887193", data.Columns[0].Data[6].ToString());
            Assert.AreEqual("77.24887193", data.Columns[1].Data[4].ToString());
            Assert.AreEqual("104.9621822", data.Columns[1].Data[5].ToString());
            Assert.AreEqual("77.24887193", data.Columns[2].Data[3].ToString());
            Assert.AreEqual("20.10254469", data.Columns[2].Data[4].ToString());
            Assert.AreEqual("145.3517002", data.Columns[3].Data[2].ToString());
            Assert.AreEqual("68.10282827", data.Columns[3].Data[3].ToString());
            Assert.AreEqual("174.16395352", data.Columns[4].Data[1].ToString());
            Assert.AreEqual("28.81225332", data.Columns[4].Data[2].ToString());
            Assert.AreEqual("194.80999056", data.Columns[5].Data[0].ToString());
            Assert.AreEqual("20.64603704", data.Columns[5].Data[1].ToString());
        }
コード例 #2
0
ファイル: WaterfallCommandTests.cs プロジェクト: mckaren/pete
        public void ApplyDataPreservesLegendsButOnlyInValuePlaces()
        {
            WaterfallCommand cmd  = new WaterfallCommand();
            DataElement      data = GetData();

            data.Columns[0].Legends[4] = "negative";
            data.Columns[0].Legends[5] = "negative";
            data.Rows[4].Legends[0]    = "negative";
            data.Rows[5].Legends[0]    = "negative";
            cmd.ApplyToData(data);

            Assert.IsNull(data.Columns[0].Legends[5]);
            Assert.IsNull(data.Columns[0].Legends[6]);
            Assert.IsNull(data.Columns[1].Legends[4]);
            Assert.AreEqual("negative", data.Columns[1].Legends[5]);
            Assert.IsNull(data.Columns[2].Legends[3]);
            Assert.AreEqual("negative", data.Columns[2].Legends[4]);
            Assert.IsNull(data.Columns[3].Legends[2]);
            Assert.IsNull(data.Columns[3].Legends[3]);
            Assert.IsNull(data.Columns[4].Legends[1]);
            Assert.IsNull(data.Columns[4].Legends[2]);
            Assert.IsNull(data.Columns[5].Legends[0]);
            Assert.IsNull(data.Columns[5].Legends[1]);
        }