Exemplo n.º 1
0
        public void GetDataPins_NoSignature_Ok()
        {
            MsSignaturesPart 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);
        }
Exemplo n.º 2
0
        public void GetDataPins_Signatures_Ok()
        {
            MsSignaturesPart part = GetPart(3);

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

            Assert.Equal(7, 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-odd-count");
            Assert.NotNull(pin);
            TestHelper.AssertPinIds(part, pin);
            Assert.Equal("2", 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 == "city");
            Assert.NotNull(pin);
            TestHelper.AssertPinIds(part, pin);
            Assert.Equal("rome", pin.Value);

            for (int n = 1; n <= 3; n++)
            {
                // library
                pin = pins.Find(p => p.Name == "library" && p.Value == $"library {n}");
                Assert.NotNull(pin);
                TestHelper.AssertPinIds(part, pin);
            }
        }