コード例 #1
0
        public void When_serializing_entity_with_Id_in_wrong_order_It_will_still_pick_the_more_specific_one()
        {
            var model = new ModelWithIdInWrongOrder {
                Id = "abc", ModelWithIdInWrongOrderId = "def", Value = "ghi"
            };

            var json = SUT.Serialize(model);

            json.Should().Be("{\"$doctype\":\"modelwithidinwrongorder\",\"id\":\"abc\",\"_id\":\"def\",\"value\":\"ghi\"}");
        }
コード例 #2
0
        public void When_serializing_entity_with_Id_in_wrong_order_It_will_not_pick_any_as__id()
        {
            var model = new ModelWithIdInWrongOrder {
                Id = "abc", ModelWithIdInWrongOrderId = "def", Value = "ghi"
            };

            var json = SUT.Serialize(model);

            json.Should().Be("{\"id\":\"abc\",\"modelWithIdInWrongOrderId\":\"def\",\"value\":\"ghi\"}");
        }