示例#1
0
        public void GetDataPins_NoTag_Empty()
        {
            NotePart part = GetPart();

            part.Tag = null;

            Assert.Empty(part.GetDataPins());
        }
示例#2
0
        public void GetDataPins_Tag_1()
        {
            NotePart part = GetPart();

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

            Assert.Single(pins);

            DataPin pin = pins[0];

            Assert.Equal(part.ItemId, pin.ItemId);
            Assert.Equal(part.Id, pin.PartId);
            Assert.Equal(part.RoleId, pin.RoleId);
            Assert.Equal("tag", pin.Name);
            Assert.Equal("some-tag", pin.Value);
        }
        public void CreateDataPin_Note_CreatedWithIds()
        {
            NotePart part = new NotePart
            {
                ItemId = Guid.NewGuid().ToString(),
                RoleId = "role",
                Tag    = "scholarly",
                Text   = "The note's text."
            };

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

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

            Assert.Equal(part.ItemId, pin.ItemId);
            Assert.Equal(part.Id, pin.PartId);
            Assert.Equal(part.RoleId, pin.RoleId);
            Assert.Equal("tag", pin.Name);
            Assert.Equal("scholarly", pin.Value);
        }