Beispiel #1
0
        public void Test_that_for_not_azure_known_and_not_serializable_and_not_convertible_types_converter_cant_be_creates()
        {
            // Arrange
            var factory = new StorageValueConvertersFactory(_metamodel);

            // Act/Assert
            Assert.ThrowsException <InvalidOperationException>(() => factory.Create(EntityType.GetProperty(nameof(TestEntity.NotSerializableTypeProperty))));
        }
Beispiel #2
0
        public void Test_that_for_not_azure_known_and_not_serializable_but_convertible_type_the_type_converter_is_used()
        {
            // Arrange
            var factory = new StorageValueConvertersFactory(_metamodel);

            // Act
            var converter = factory.Create(EntityType.GetProperty(nameof(TestEntity.ConvertableTypeProperty)));

            // Assert
            Assert.IsNotNull(converter);
            Assert.IsInstanceOfType(converter, typeof(TypeDescriptorStringStorageValueConverter));
        }
Beispiel #3
0
        public void Test_that_for_azure_known_type_the_pass_through_converter_is_used()
        {
            // Arrange
            var factory = new StorageValueConvertersFactory(_metamodel);

            // Act
            var converter = factory.Create(EntityType.GetProperty(nameof(TestEntity.AzureKnownTypeProperty)));

            // Assert
            Assert.IsNotNull(converter);
            Assert.IsInstanceOfType(converter, typeof(PassThroughStorageValueConverter));
        }