コード例 #1
0
        public void GetDataPins_Coordinates_Ok()
        {
            ChronotopicsPart part = GetPart(3);

            List <DataPin> pins = part.GetDataPins(null).ToList();

            Assert.Equal(12, pins.Count);
            TestHelper.AssertValidDataPinNames(pins);

            DataPin pin = pins.Find(p => p.Name == "tot-count");

            Assert.NotNull(pin);
            TestHelper.AssertPinIds(part, pin);
            Assert.Equal("3", pin.Value);

            pin = pins.Find(p => p.Name == "tag-even-count");
            Assert.NotNull(pin);
            TestHelper.AssertPinIds(part, pin);
            Assert.Equal("1", pin.Value);

            pin = pins.Find(p => p.Name == "tag-odd-count");
            Assert.NotNull(pin);
            TestHelper.AssertPinIds(part, pin);
            Assert.Equal("2", pin.Value);

            pin = pins.Find(p => p.Name == "tag-place" && p.Value == "odd:place 1");
            Assert.NotNull(pin);
            TestHelper.AssertPinIds(part, pin);

            pin = pins.Find(p => p.Name == "tag-place" && p.Value == "even:place 2");
            Assert.NotNull(pin);
            TestHelper.AssertPinIds(part, pin);

            pin = pins.Find(p => p.Name == "tag-place" && p.Value == "odd:place 3");
            Assert.NotNull(pin);
            TestHelper.AssertPinIds(part, pin);

            for (int n = 1; n <= 3; n++)
            {
                HistoricalDate date = HistoricalDate.Parse(n + 1200 + " AD");
                double         d    = date.GetSortValue();

                pin = pins.Find(p => p.Name == "date-value" &&
                                p.Value == d.ToString(CultureInfo.InvariantCulture));
                Assert.NotNull(pin);
                TestHelper.AssertPinIds(part, pin);

                string tag = n % 2 == 0 ? "even" : "odd";
                pin = pins.Find(p => p.Name == "tag-date" &&
                                p.Value == $"{tag}:{+d:0000.00;-d:0000.00}");
                Assert.NotNull(pin);
                TestHelper.AssertPinIds(part, pin);
            }
        }
コード例 #2
0
        public void GetDataPins_NoCoordinates_Ok()
        {
            ChronotopicsPart part = GetPart(0);

            List <DataPin> pins = part.GetDataPins(null).ToList();

            TestHelper.AssertValidDataPinNames(pins);

            Assert.Single(pins);
            DataPin pin = pins[0];

            Assert.Equal("tot-count", pin.Name);
            TestHelper.AssertPinIds(part, pin);
            Assert.Equal("0", pin.Value);
        }