public void It_skips_mismatched_types()
        {
            var data = new Dictionary<string, EntityProperty>
                {
                    { "StringProp", new EntityProperty(5) },
                    { "IntProp", new EntityProperty("string input") },
                };
            var instance = new ClrPocoWithProp();

            var entityType = CreateModel().GetEntityType(typeof(ClrPocoWithProp));
            var entry = _factory.Create(entityType, instance);
            var adapter = new StateEntryTableEntityAdapter<ClrPocoWithProp>(entry);

            adapter.ReadEntity(data, null);

            Assert.Equal(default(string), instance.StringProp);
            Assert.Equal(default(int), instance.IntProp);
        }
        public void It_writes_to_dictionary()
        {
            var instance = new ClrPocoWithProp
                {
                    PartitionKey = "A",
                    RowKey = "B",
                    StringProp = "C",
                    IntProp = 5,
                    Timestamp = DateTimeOffset.UtcNow,
                };
            var entry = _factory.Create(CreateModel().GetEntityType(typeof(ClrPocoWithProp)), instance);
            var adapter = new StateEntryTableEntityAdapter<ClrPocoWithProp>(entry);

            var expected = new Dictionary<string, EntityProperty>
                {
                    { "IntProp", new EntityProperty(instance.IntProp) },
                    { "StringProp", new EntityProperty(instance.StringProp) },
                };

            Assert.Equal(expected, adapter.WriteEntity(null));
        }
        public void It_reads_from_dictionary()
        {
            var data = new Dictionary<string, EntityProperty>
                {
                    { "StringProp", new EntityProperty("StringVal") },
                    { "IntProp", new EntityProperty(5) },
                };
            var instance = new ClrPocoWithProp();

            var entityType = CreateModel().GetEntityType(typeof(ClrPocoWithProp));
            var entry = _factory.Create(entityType, instance);
            var adapter = new StateEntryTableEntityAdapter<ClrPocoWithProp>(entry);

            adapter.ReadEntity(data, null);

            Assert.Equal("StringVal", instance.StringProp);
            Assert.Equal(5, instance.IntProp);
        }