Exemplo n.º 1
0
        public void Copy_Options_ResolveXmlDocumentationFileName()
        {
            // arrange
            var options = new SchemaOptions
            {
                QueryTypeName                   = "A",
                MutationTypeName                = "B",
                SubscriptionTypeName            = "C",
                StrictValidation                = false,
                SortFieldsByName                = true,
                UseXmlDocumentation             = false,
                ResolveXmlDocumentationFileName = assembly => "docs.xml",
                DefaultBindingBehavior          = BindingBehavior.Explicit,
                FieldMiddleware                 = FieldMiddlewareApplication.AllFields,
                PreserveSyntaxNodes             = true
            };

            // act
            var copied = new ReadOnlySchemaOptions(options);

            // assert
            Assert.Same(
                options.ResolveXmlDocumentationFileName,
                copied.ResolveXmlDocumentationFileName);
        }
Exemplo n.º 2
0
        public void Copy_Options_Defaults()
        {
            // arrange
            var options = new SchemaOptions();

            // act
            var copied = new ReadOnlySchemaOptions(options);

            // assert
            copied.MatchSnapshot();
        }
Exemplo n.º 3
0
        public void Copy_Options()
        {
            // arrange
            var options = new SchemaOptions
            {
                QueryTypeName          = "A",
                MutationTypeName       = "B",
                SubscriptionTypeName   = "C",
                StrictValidation       = false,
                SortFieldsByName       = true,
                UseXmlDocumentation    = false,
                DefaultBindingBehavior = BindingBehavior.Explicit,
                FieldMiddleware        = FieldMiddlewareApplication.AllFields,
                PreserveSyntaxNodes    = true
            };

            // act
            var copied = new ReadOnlySchemaOptions(options);

            // assert
            copied.MatchSnapshot();
        }