Пример #1
0
        public void UnionType_Contains_IObjectType()
        {
            // arrange
            Schema schema = CreateSchema();

            var context = new Mock <IResolverContext>(
                MockBehavior.Strict);
            IUnionType  fooBar = schema.GetType <UnionType>("FooBar");
            IObjectType tea    = schema.GetType <ObjectType>("Tea");
            IObjectType bar    = schema.GetType <ObjectType>("Bar");

            // act
            bool shouldBeFalse = fooBar.ContainsType(tea);
            bool shouldBeTrue  = fooBar.ContainsType(bar);

            // assert
            Assert.True(shouldBeTrue);
            Assert.False(shouldBeFalse);
        }
Пример #2
0
 protected override IUnionInstance OnCreateUnion(ISymbolInfo entry, IUnionType unionType, ISymbol parent) =>
 new UnionInstance((AdsSymbolEntry)entry, unionType, parent, base.services);
Пример #3
0
 internal UnionInstance(AdsSymbolEntry entry, IUnionType type, ISymbol parent, ISymbolFactoryServices factoryServices) : base(entry, type, parent, factoryServices)
 {
     base.category = DataTypeCategory.Union;
 }
Пример #4
0
 internal UnionInstance(ISymbol parent, IUnionType type, string instanceName, int fieldOffset) : base(parent, type, instanceName, fieldOffset, ((ISymbolFactoryServicesProvider)parent).FactoryServices)
 {
     base.category = DataTypeCategory.Union;
 }
Пример #5
0
 protected abstract IUnionInstance OnCreateUnion(ISymbolInfo entry, IUnionType unionType, ISymbol parent);