예제 #1
0
        public void CanRemovePropertyByIndexFromThePropertyMap()
        {
            //Arrange ------------
            var          row           = new gt.Row();
            const string propertyName  = "STYLE";
            const string propertyValue = "border: 7px solid orange";

            //Act -----------------
            row.AddProperty(new Property(propertyName, propertyValue));
            row.RemoveProperty(0);

            //Assert --------------
            Assert.That(row.PropertyMap.Count() == 0);
        }
예제 #2
0
        public void CanAddAndRetrieveAProperty()
        {
            //Arrange ------------
            var          row           = new gt.Row();
            const string propertyName  = "STYLE";
            const string propertyValue = "border: 7px solid orange";

            //Act -----------------
            var property = row.AddProperty(new Property(propertyName, propertyValue));

            //Assert --------------
            Assert.That(row.PropertyMap.ToList()[0].Name == propertyName);
            Assert.That((string)row.PropertyMap.ToList()[0].Value == propertyValue);
            Assert.That(property.Name == propertyName);
            Assert.That(property.Value == propertyValue);
        }