예제 #1
0
        public void AddNameLookup_Single()
        {
            // arrange
            ISchemaBuilder schemaBuilder = SchemaBuilder.New().AddQueryType <CustomQueryType>();

            // act
            schemaBuilder.AddNameLookup("OriginalType1", "NewType1", "Schema1");
            schemaBuilder.AddNameLookup("OriginalType2", "NewType2", "Schema2");

            // assert
            IReadOnlyDictionary <(NameString, NameString), NameString> lookup =
                schemaBuilder
                .Create()
                .GetType <CustomQueryType>(nameof(CustomQueryType))
                .Context
                .GetNameLookup();

            Assert.Equal("OriginalType1", lookup[("NewType1", "Schema1")]);