Beispiel #1
0
        public void GetDataPins_Entries_Ok()
        {
            MsContentsPart part = GetPart(3);

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

            Assert.Equal(7, pins.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++)
            {
                // work
                pin = pins.Find(p => p.Name == "work" && p.Value == $"work.{n}");
                Assert.NotNull(pin);
                TestHelper.AssertPinIds(part, pin);

                // title
                pin = pins.Find(p => p.Name == "title" && p.Value == $"title {n}");
                Assert.NotNull(pin);
                TestHelper.AssertPinIds(part, pin);
            }
        }
Beispiel #2
0
        public void GetDataPins_NoEntries_Ok()
        {
            MsContentsPart part = GetPart(0);

            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);
        }
Beispiel #3
0
        public void GetDataPins_Contents_Ok()
        {
            MsContentsPart 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 == "author" && p.Value == "authorodd");
            Assert.NotNull(pin);
            TestHelper.AssertPinIds(part, pin);

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

            pin = pins.Find(p => p.Name == "claimed-author" &&
                            p.Value == "claimedodd");
            Assert.NotNull(pin);
            TestHelper.AssertPinIds(part, pin);

            pin = pins.Find(p => p.Name == "claimed-author" &&
                            p.Value == "claimedeven");
            Assert.NotNull(pin);
            TestHelper.AssertPinIds(part, pin);

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

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