public void GetDataPins_Persons_Ok() { CitedPersonsPart part = GetPart(3); List <DataPin> pins = part.GetDataPins(null).ToList(); Assert.Equal(7, pins.Count); TestHelper.AssertValidDataPinNames(pins); // tot-count DataPin pin = pins.Find(p => p.Name == "tot-count"); Assert.NotNull(pin); TestHelper.AssertPinIds(part, pin); Assert.Equal("3", pin.Value); for (int n = 1; n <= 3; n++) { string name = "joe " + new string((char)('a' + n - 1), 3); pin = pins.Find(p => p.Name == "name" && p.Value == name); Assert.NotNull(pin); TestHelper.AssertPinIds(part, pin); pin = pins.Find(p => p.Name == "id" && p.Value == $"person {n}"); Assert.NotNull(pin); TestHelper.AssertPinIds(part, pin); } }
public void GetDataPins_NoPersons_Ok() { CitedPersonsPart 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); }