Пример #1
0
        public void Should_AbleToSetExternalDocumentationWithBuilder()
        {
            var edBuilder = new ExternalDocumentationBuilder().Url("url");

            var swaggerRoot = GetBasicSwaggerRootBuilder().ExternalDocumentation(edBuilder).Build();

            Assert.Equal(edBuilder.Build().Url, swaggerRoot.ExternalDocumentation.Url);
        }
Пример #2
0
        public void ExternalDocumentationWithBuilder_ShouldBeSettable()
        {
            var exBuilder = new ExternalDocumentationBuilder().Url("url");

            var result = GetInt32SchemaBuilder().ExternalDocumentation(exBuilder).Build();

            Assert.Equal(exBuilder.Build().Url, result.ExternalDocumentation.Url);
        }
Пример #3
0
        public void Should_AbleToSetExternalDocumentationWithBuilder()
        {
            var externalDocumentationBuilder = new ExternalDocumentationBuilder().Url("https://github.com/yahehe/Nancy.Swagger");

            var operation = GetBasicBuilderWithResponse().ExternalDocumentation(externalDocumentationBuilder).Build();

            Assert.NotNull(operation.ExternalDocumentation);
            Assert.Equal(externalDocumentationBuilder.Build().Url, operation.ExternalDocumentation.Url);
        }
Пример #4
0
 public SchemaBuilder <TModel> ExternalDocumentation(ExternalDocumentationBuilder documentation)
 {
     this.documentation = documentation.Build();
     return(this);
 }
 public void Should_ThrowRequiredFieldException_WhenUrlIsNotSet()
 {
     Assert.Throws <RequiredFieldException>(() => builder.Build());
     Assert.Throws <RequiredFieldException>(() => builder.Description("desc").Build());
 }
Пример #6
0
 /// <summary>
 /// Additional external documentation
 /// </summary>
 /// <param name="documentation">
 /// The documentation.
 /// </param>
 /// <returns>
 /// The <see cref="SwaggerRootBuilder"/>.
 /// </returns>
 public SwaggerRootBuilder ExternalDocumentation(ExternalDocumentationBuilder documentation)
 {
     this.documentation = documentation.Build();
     return(this);
 }
Пример #7
0
 /// <summary>
 /// The external documentation.
 /// </summary>
 /// <param name="externalDocumentation">
 /// The external documentation.
 /// </param>
 /// <returns>
 /// The <see cref="TagBuilder"/>.
 /// </returns>
 public TagBuilder ExternalDocumentation(ExternalDocumentationBuilder externalDocumentation)
 {
     this.documentation = externalDocumentation.Build();
     return this;
 }
Пример #8
0
 /// <summary>
 /// Additional external documentation
 /// </summary>
 /// <param name="documentation">
 /// The documentation.
 /// </param>
 /// <returns>
 /// The <see cref="OperationBuilder"/>.
 /// </returns>
 public OperationBuilder ExternalDocumentation(ExternalDocumentationBuilder documentation)
 {
     this.documentation = documentation.Build();
     return(this);
 }
Пример #9
0
 /// <summary>
 /// The external documentation.
 /// </summary>
 /// <param name="externalDocumentation">
 /// The external documentation.
 /// </param>
 /// <returns>
 /// The <see cref="TagBuilder"/>.
 /// </returns>
 public TagBuilder ExternalDocumentation(ExternalDocumentationBuilder externalDocumentation)
 {
     this.documentation = externalDocumentation.Build();
     return(this);
 }
Пример #10
0
 /// <summary>
 /// Additional external documentation 
 /// </summary>
 /// <param name="documentation">
 /// The documentation.
 /// </param>
 /// <returns>
 /// The <see cref="OperationBuilder"/>.
 /// </returns>
 public OperationBuilder ExternalDocumentation(ExternalDocumentationBuilder documentation)
 {
     this.documentation = documentation.Build();
     return this;
 }