Beispiel #1
0
 public void ShouldAcceptMultipleValues()
 {
     DataRow row = new DataRow("abc", 123, 3.4);
     Assert.AreEqual("abc", row.GetValue(new DataBinding(0, null)));
     Assert.AreEqual(123, row.GetValue(new DataBinding(1, null)));
     Assert.AreEqual(3.4, row.GetValue(new DataBinding(2, null)));
 }
Beispiel #2
0
        public void ShouldProvideFluentInterfaceForBuildingMetadata()
        {
            PropertyBag extraMetadata = new PropertyBag();
            extraMetadata.SetValue("Author", "Lewis Carroll");
            extraMetadata.SetValue("Title", "The Jabberwocky");

            DataRow row = new DataRow("abc")
                .WithMetadata("Description", "Frumious")
                .WithMetadata("Name", "Bandersnatch")
                .WithMetadata(extraMetadata);
            Assert.AreEqual("abc", row.GetValue(new DataBinding(0, null)));

            PropertyBag map = DataItemUtils.GetMetadata(row);
            Assert.Count(4, map);
            Assert.AreEqual("Frumious", map.GetValue("Description"));
            Assert.AreEqual("Bandersnatch", map.GetValue("Name"));
            Assert.AreEqual("Lewis Carroll", map.GetValue("Author"));
            Assert.AreEqual("The Jabberwocky", map.GetValue("Title"));
        }
Beispiel #3
0
        public void CanGetDescriptiveDataBindingsFromItem()
        {
            DataRow item = new DataRow("abc", "def");

            Assert.AreElementsEqual(new[]
            {
                new DataBinding(0, null),
                new DataBinding(1, null),
            }, item.GetBindingsForInformalDescription());
        }
Beispiel #4
0
 public void ShouldAssumeASingleNullValueWasIntendedIfConstructorArgumentIsNull()
 {
     DataRow row = new DataRow(null);
     Assert.IsNull(row.GetValue(new DataBinding(0, null)));
 }
Beispiel #5
0
 public void ShouldBeDynamic()
 {
     DataRow row = new DataRow(null);
     Assert.IsTrue(row.IsDynamic);
 }