< Summary

Information
Class: Elsa.Expressions.JavaScript.TypeDefinitions.Builders.TypeDefinitionBuilder
Assembly: Elsa.Expressions.JavaScript
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.JavaScript/TypeDefinitions/Builders/TypeDefinitionBuilder.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 6
Coverable lines: 6
Total lines: 34
Line coverage: 0%
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%210%
Name(...)100%210%
DeclarationKeyword(...)100%210%
BuildTypeDefinition()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.JavaScript/TypeDefinitions/Builders/TypeDefinitionBuilder.cs

#LineLine coverage
 1using Elsa.Expressions.JavaScript.TypeDefinitions.Models;
 2
 3namespace Elsa.Expressions.JavaScript.TypeDefinitions.Builders;
 4
 5/// <summary>
 6/// A builder API for building <see cref="TypeDefinition"/>s.
 7/// </summary>
 8public class TypeDefinitionBuilder
 9{
 010    private readonly TypeDefinition _typeDefinition = new();
 11
 12    /// <summary>
 13    /// Set the name of the function.
 14    /// </summary>
 15    public TypeDefinitionBuilder Name(string name)
 16    {
 017        _typeDefinition.Name = name;
 018        return this;
 19    }
 20
 21    /// <summary>
 22    /// Set the return type of the function.
 23    /// </summary>
 24    public TypeDefinitionBuilder DeclarationKeyword(string keyword)
 25    {
 026        _typeDefinition.DeclarationKeyword = keyword;
 027        return this;
 28    }
 29
 30    /// <summary>
 31    /// Build a <see cref="TypeDefinition"/> using the collected information.
 32    /// </summary>
 033    public TypeDefinition BuildTypeDefinition() => new();
 34}