コード例 #1
0
        public void ApplyStructuralProperty_ThrowsArgumentNull_StructuralProperty()
        {
            var deserializer = new ODataEntityDeserializer(_deserializerProvider);

            Assert.ThrowsArgumentNull(
                () => deserializer.ApplyStructuralProperty(42, structuralProperty: null, entityType: _productEdmType, readContext: _readContext),
                "structuralProperty");
        }
コード例 #2
0
        public void ApplyStructuralProperty_SetsProperty()
        {
            // Arrange
            var           deserializer = new ODataEntityDeserializer(_deserializerProvider);
            Product       product      = new Product();
            ODataProperty property     = new ODataProperty {
                Name = "ID", Value = 42
            };

            // Act
            deserializer.ApplyStructuralProperty(product, property, _productEdmType, _readContext);

            // Assert
            Assert.Equal(42, product.ID);
        }
コード例 #3
0
        public void ApplyStructuralProperty_SetsProperty()
        {
            // Arrange
            var deserializer = new ODataEntityDeserializer(_deserializerProvider);
            Product product = new Product();
            ODataProperty property = new ODataProperty { Name = "ID", Value = 42 };

            // Act
            deserializer.ApplyStructuralProperty(product, property, _productEdmType, _readContext);

            // Assert
            Assert.Equal(42, product.ID);
        }
コード例 #4
0
 public void ApplyStructuralProperty_ThrowsArgumentNull_StructuralProperty()
 {
     var deserializer = new ODataEntityDeserializer(_deserializerProvider);
     Assert.ThrowsArgumentNull(
         () => deserializer.ApplyStructuralProperty(42, structuralProperty: null, entityType: _productEdmType, readContext: _readContext),
         "structuralProperty");
 }