public void GetConsumerBindingForNotSupportedTypeTest() { ConsumerBindingFactory factory = new ConsumerBindingFactory(null, _configuration); UATypeInfo typeInfo = new UATypeInfo(BuiltInType.NodeId, -2, new int[] { }); Assert.Throws <UnsupportedTypeException>(() => factory.GetConsumerBinding(_typeMetadata.RepositoryGroupName, _typeMetadata.TypeName, typeInfo)); }
public void GetConsumerBindingForMultidimensionalTypeTest() { ConsumerBindingFactory factory = new ConsumerBindingFactory(null, _configuration); UATypeInfo typeInfo = new UATypeInfo(BuiltInType.Byte, 2, new int[] { 21, 37 }); Assert.Throws <ValueRankOutOfRangeException>(() => factory.GetConsumerBinding(_typeMetadata.RepositoryGroupName, _typeMetadata.TypeName, typeInfo)); }
public void GetConsumerBindingTest() { ConsumerBindingFactory factory = new ConsumerBindingFactory(null, _configuration); factory.Initialise(_consumerViewModel); UATypeInfo typeInfo = new UATypeInfo(BuiltInType.Byte, -1, new int[] { }); IConsumerBinding binding = factory.GetConsumerBinding(_typeMetadata.RepositoryGroupName, _typeMetadata.TypeName, typeInfo); Assert.NotNull(binding); }
public void ConstructorTest() { ConsumerBindingFactory sut = new ConsumerBindingFactory(null, _configuration); Assert.Null(sut.GetType() .GetField("_logger", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .GetValue(sut)); Assert.NotNull(sut.GetType() .GetField("_configuration", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic) .GetValue(sut)); }
public void GetConsumerBindingForNullTypeTest() { ConsumerBindingFactory factory = new ConsumerBindingFactory(null, _configuration); Assert.Throws <ArgumentNullException>(() => factory.GetConsumerBinding(_typeMetadata.RepositoryGroupName, _typeMetadata.TypeName, null)); }