< Summary

Information
Class: Utility.Components.Ascii.Ascii
Assembly: Utility
File(s): /home/runner/work/Utility-Blazor/Utility-Blazor/src/Utility/Components/Ascii/Ascii.razor
Tag: 327_19881906754
Line coverage
0%
Covered lines: 0
Uncovered lines: 17
Coverable lines: 17
Total lines: 75
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
BuildRenderTree(...)100%210%
.ctor()100%210%
GetAsciiValues()100%210%

File(s)

/home/runner/work/Utility-Blazor/Utility-Blazor/src/Utility/Components/Ascii/Ascii.razor

#LineLine coverage
 1<div class="container">
 2    <div class="row">
 3        <div class="col">
 4
 5            <label class="label-control">Character:</label>
 6            <div class="input-group">
 7                <input id="ascii" name="ascii" class="form-control" @bind="AsciiValue" placeholder="'" maxlength="1">
 8                <span class="input-group-btn">
 9                    <button id="btnAscii" name="btnAscii" type="button" class="btn btn-success float-right" @onclick="Ge
 10                </span>
 11            </div>
 12
 13        </div>
 14    </div>
 15
 16    <br />
 17
 18    <div class="row">
 19        <div class="col">
 20
 21            <table id="asciiItems">
 22                <thead>
 23                    <tr>
 24                        <th>Char</th>
 25                        <th>Dec</th>
 26                        <th>Hex</th>
 27                        <th>Oct</th>
 28                    </tr>
 29                </thead>
 30                <tfoot></tfoot>
 31                <tbody>
 32                    <tr>
 033                        <td>@Char</td>
 034                        <td>@Dec</td>
 035                        <td>@Hex</td>
 036                        <td>@Oct</td>
 37                    </tr>
 38                </tbody>
 39            </table>
 40
 41        </div>
 42    </div>
 43
 44    <hr />
 45
 46    <div class="row">
 47        <div class="col">
 48            <p>Inspired from <a href="http://asciivalue.com/" target="_blank">ASCIIvalue</a></p>
 49        </div>
 50    </div>
 51</div>
 52
 53@code {
 054    string AsciiValue = "'";
 055    string Char = string.Empty;
 056    string Dec = string.Empty;
 057    string Hex = string.Empty;
 058    string Oct = string.Empty;
 59
 60    void GetAsciiValues()
 061    {
 062        char character = char.Parse(AsciiValue);
 63
 064        Char = AsciiValue;
 65
 066        int uiValue = (int)character;
 067        Dec = uiValue.ToString();
 68
 069        Hex = String.Concat(AsciiValue.Select(x => ((int)x).ToString("x2")));
 70
 71        // Oct = Convert.ToInt32(AsciiValue, 8).ToString(); // Could not find any recognizable digits.
 072        Oct = Convert.ToString(character, 8);
 073    }
 74
 75}