Ejemplo n.º 1
0
        public void Part_Is_Serializable()
        {
            PersonHandPart part = GetPart();

            string         json  = TestHelper.SerializePart(part);
            PersonHandPart part2 =
                TestHelper.DeserializePart <PersonHandPart>(json);

            Assert.Equal(part.Id, part2.Id);
            Assert.Equal(part.TypeId, part2.TypeId);
            Assert.Equal(part.ItemId, part2.ItemId);
            Assert.Equal(part.RoleId, part2.RoleId);
            Assert.Equal(part.CreatorId, part2.CreatorId);
            Assert.Equal(part.UserId, part2.UserId);

            // TODO: details
        }
        public void Seed_Ok()
        {
            PersonHandPartSeeder seeder = new PersonHandPartSeeder();

            seeder.SetSeedOptions(_seedOptions);

            IPart part = seeder.GetPart(_item, null, _factory);

            Assert.NotNull(part);

            PersonHandPart p = part as PersonHandPart;

            Assert.NotNull(p);

            TestHelper.AssertPartMetadata(p);

            Assert.NotNull(p.PersonId);
            Assert.NotNull(p.Job);
        }
Ejemplo n.º 3
0
        public void GetDataPins_Ok()
        {
            PersonHandPart part = GetPart();

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

            Assert.Equal(2, pins.Count);
            TestHelper.AssertValidDataPinNames(pins);

            DataPin pin = pins.Find(p => p.Name == "person-id");

            Assert.NotNull(pin);
            TestHelper.AssertPinIds(part, pin);
            Assert.Equal("pusillus", pin.Value);

            pin = pins.Find(p => p.Name == "job");
            Assert.NotNull(pin);
            TestHelper.AssertPinIds(part, pin);
            Assert.Equal("copyst", pin.Value);
        }