Exemple #1
0
 public void GetEnumerator_will_merge_all_values()
 {
     var composite = PropertyStore.Compose(
         Properties.FromValue(new { a = "1", b = "2" }),
         Properties.FromValue(new { c = "1", d = "2" })
         );
 }
Exemple #2
0
        public void GetPropertyType_checks_each()
        {
            var composite = PropertyStore.Compose(
                Properties.FromValue(new { a = 1, b = 2.0 }),
                Properties.FromValue(new { c = "1", d = 2.0m })
                );

            Assert.Equal(typeof(string), composite.GetPropertyType("c"));
        }
Exemple #3
0
        public void GetEnumerator_will_dedupe_values()
        {
            var composite = PropertyStore.Compose(
                Properties.FromValue(new { a = "1", b = "2" }),
                Properties.FromValue(new { a = "1000", d = "2" })
                );

            Assert.Equal(new [] { "a", "b", "d" }, composite.Select(t => t.Key));
        }
Exemple #4
0
        public void TryGetProperty_checks_each()
        {
            var composite = PropertyStore.Compose(
                Properties.FromValue(new { a = "1", b = "2" }),
                Properties.FromValue(new { c = "1", d = "2" })
                );

            object result;

            Assert.True(composite.TryGetProperty("c", out result));
            Assert.Equal("1", result);
        }