Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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());
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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;
 }