< Summary

Information
Class: Elsa.Http.Downloadable
Assembly: Elsa.Http
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Http/Models/Downloadable.cs
Line coverage
50%
Covered lines: 6
Uncovered lines: 6
Coverable lines: 12
Total lines: 52
Line coverage: 50%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%
.ctor(...)100%210%
get_Stream()100%11100%
get_Filename()100%11100%
get_ContentType()100%11100%
get_ETag()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Http/Models/Downloadable.cs

#LineLine coverage
 1using System.Text.Json.Serialization;
 2
 3namespace Elsa.Http;
 4
 5/// <summary>
 6/// Represents a downloadable object.
 7/// </summary>
 8public class Downloadable
 9{
 10    /// <summary>
 11    /// Initializes a new instance of the <see cref="Downloadable"/> class.
 12    /// </summary>
 13    [JsonConstructor]
 2414    public Downloadable()
 15    {
 2416    }
 17
 18    /// <summary>
 19    /// Initializes a new instance of the <see cref="Downloadable"/> class.
 20    /// </summary>
 21    /// <param name="stream">The stream to download.</param>
 22    /// <param name="filename">The filename to use when downloading the stream.</param>
 23    /// <param name="contentType">The content type to use when downloading the stream.</param>
 24    /// <param name="eTag">The ETag to use when downloading the stream.</param>
 025    public Downloadable(Stream stream, string? filename = default, string? contentType = default, string? eTag = default
 26    {
 027        Stream = stream;
 028        Filename = filename;
 029        ContentType = contentType;
 030        ETag = eTag;
 031    }
 32
 33    /// <summary>
 34    /// The stream to download.
 35    /// </summary>
 4736    public Stream Stream { get; set; } = default!;
 37
 38    /// <summary>
 39    /// The filename to use when downloading the stream.
 40    /// </summary>
 3541    public string? Filename { get; set; }
 42
 43    /// <summary>
 44    /// The content type to use when downloading the stream.
 45    /// </summary>
 4746    public string? ContentType { get; set; }
 47
 48    /// <summary>
 49    /// The ETag to use when downloading the stream.
 50    /// </summary>
 2151    public string? ETag { get; set; }
 52}