public void GetDataPins_NoEntries_Ok()
        {
            AvailableWitnessesPart part = GetPart();

            part.Witnesses.Clear();

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

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

            Assert.Equal("tot-count", pin.Name);
            TestHelper.AssertPinIds(part, pin);
            Assert.Equal("0", pin.Value);
        }
        public void GetDataPins_Entries_Ok()
        {
            AvailableWitnessesPart part = GetEmptyPart();

            const string ids = "ABC";

            for (int n = 1; n <= 3; n++)
            {
                part.Witnesses.Add(new AvailableWitness
                {
                    Id        = new string(ids[n - 1], 1),
                    IsPartial = n == 2,
                    Note      = "A note"
                });
            }

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

            Assert.Equal(4, pins.Count);

            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 == "witness" && p.Value == "A");
            Assert.NotNull(pin);
            TestHelper.AssertPinIds(part, pin);

            pin = pins.Find(p => p.Name == "witness" && p.Value == "B");
            Assert.NotNull(pin);
            TestHelper.AssertPinIds(part, pin);

            pin = pins.Find(p => p.Name == "witness" && p.Value == "C");
            Assert.NotNull(pin);
            TestHelper.AssertPinIds(part, pin);
        }