< Summary

Information
Class: IceRpc.Slice.SliceOperationAttribute
Assembly: IceRpc.Slice
File(s): /home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc.Slice/SliceOperationAttribute.cs
Tag: 701_22528036593
Line coverage
0%
Covered lines: 0
Uncovered lines: 6
Coverable lines: 6
Total lines: 42
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
0%
Covered methods: 0
Total methods: 6
Method coverage: 0%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Name()100%210%
get_CompressReturn()100%210%
get_EncodedReturn()100%210%
get_ExceptionSpecification()100%210%
get_Idempotent()100%210%
.ctor(...)100%210%

File(s)

/home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc.Slice/SliceOperationAttribute.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3using System.ComponentModel;
 4using ZeroC.Slice;
 5
 6namespace IceRpc.Slice;
 7
 8/// <summary>Represents an attribute that the Slice compiler uses to mark helper methods it generates on Service
 9/// interfaces.</summary>
 10[AttributeUsage(AttributeTargets.Method, Inherited = false)]
 11[EditorBrowsable(EditorBrowsableState.Never)]
 12public sealed class SliceOperationAttribute : Attribute
 13{
 14    /// <summary>Gets the operation name.</summary>
 15    /// <value>The operation name.</value>
 016    public string Name { get; }
 17
 18    /// <summary>Gets a value indicating whether the return value needs to be compressed.</summary>
 19    /// <value><see langword="true"/> if the return value needs to be compressed; otherwise, <see langword="false"/>.
 20    /// </value>
 021    public bool CompressReturn { get; init; }
 22
 23    /// <summary>Gets a value indicating whether the non-stream portion of the return value is pre-encoded by the
 24    /// application.</summary>
 25    /// <value><see langword="true"/> if the non-stream portion of the return value is pre-encoded; otherwise,
 26    /// <see langword="false"/>.</value>
 027    public bool EncodedReturn { get; init; }
 28
 29    /// <summary>Gets the exception specification of the operation.</summary>
 30    /// <value>An array of Slice exception types that the operation may throw.</value>
 31    /// <remarks>Slice1-only.</remarks>
 32    /// <seealso cref="SliceException"/>
 033    public Type[] ExceptionSpecification { get; init; } = [];
 34
 35    /// <summary>Gets a value indicating whether the operation is idempotent.</summary>
 36    /// <value><see langword="true"/> if the operation is idempotent; otherwise, <see langword="false"/>.</value>
 037    public bool Idempotent { get; init; }
 38
 39    /// <summary>Constructs a Slice operation attribute.</summary>
 40    /// <param name="name">The operation name.</param>
 041    public SliceOperationAttribute(string name) => Name = name;
 42}