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); }
protected override IUnionInstance OnCreateUnion(ISymbolInfo entry, IUnionType unionType, ISymbol parent) => new UnionInstance((AdsSymbolEntry)entry, unionType, parent, base.services);
internal UnionInstance(AdsSymbolEntry entry, IUnionType type, ISymbol parent, ISymbolFactoryServices factoryServices) : base(entry, type, parent, factoryServices) { base.category = DataTypeCategory.Union; }
internal UnionInstance(ISymbol parent, IUnionType type, string instanceName, int fieldOffset) : base(parent, type, instanceName, fieldOffset, ((ISymbolFactoryServicesProvider)parent).FactoryServices) { base.category = DataTypeCategory.Union; }
protected abstract IUnionInstance OnCreateUnion(ISymbolInfo entry, IUnionType unionType, ISymbol parent);