• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

HicServices / RDMP / 6245535001

20 Sep 2023 07:44AM UTC coverage: 57.013%. First build
6245535001

push

github

web-flow
8.1.0 Release (#1628)

* Bump Newtonsoft.Json from 13.0.1 to 13.0.2

Bumps [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) from 13.0.1 to 13.0.2.
- [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Commits](https://github.com/JamesNK/Newtonsoft.Json/compare/13.0.1...13.0.2)

---
updated-dependencies:
- dependency-name: Newtonsoft.Json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump NLog from 5.0.5 to 5.1.0

Bumps [NLog](https://github.com/NLog/NLog) from 5.0.5 to 5.1.0.
- [Release notes](https://github.com/NLog/NLog/releases)
- [Changelog](https://github.com/NLog/NLog/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/NLog/NLog/compare/v5.0.5...v5.1.0)

---
updated-dependencies:
- dependency-name: NLog
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump NLog from 5.0.5 to 5.1.0

* Fix -r flag - should have been --results-directory all along

* Bump Newtonsoft.Json from 13.0.1 to 13.0.2

* Bump YamlDotNet from 12.0.2 to 12.1.0

Bumps [YamlDotNet](https://github.com/aaubry/YamlDotNet) from 12.0.2 to 12.1.0.
- [Release notes](https://github.com/aaubry/YamlDotNet/releases)
- [Commits](https://github.com/aaubry/YamlDotNet/compare/v12.0.2...v12.1.0)

---
updated-dependencies:
- dependency-name: YamlDotNet
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump Moq from 4.18.2 to 4.18.3

Bumps [Moq](https://github.com/moq/moq4) from 4.18.2 to 4.18.3.
- [Release notes](https://github.com/moq/moq4/releases)
- [Changelog](https://github.com/moq/moq4/blob/main/CHANGELOG.md)
- [Commits](https://github.com/moq/moq4/compare/v4.18.2...v4.18.3)

---
updated-dependencies:
- dependency-name: Moq
... (continued)

10732 of 20257 branches covered (0.0%)

Branch coverage included in aggregate %.

48141 of 48141 new or added lines in 1086 files covered. (100.0%)

30685 of 52388 relevant lines covered (58.57%)

7387.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.18
/Rdmp.Core/DataExport/Data/DeployedExtractionFilterParameter.cs
1
// Copyright (c) The University of Dundee 2018-2023
2
// This file is part of the Research Data Management Platform (RDMP).
3
// RDMP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
4
// RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
5
// You should have received a copy of the GNU General Public License along with RDMP. If not, see <https://www.gnu.org/licenses/>.
6

7
using System.Collections.Generic;
8
using System.Data.Common;
9
using FAnsi.Discovery;
10
using FAnsi.Discovery.QuerySyntax;
11
using Rdmp.Core.Curation.Data;
12
using Rdmp.Core.MapsDirectlyToDatabaseTable;
13
using Rdmp.Core.MapsDirectlyToDatabaseTable.Attributes;
14
using Rdmp.Core.QueryBuilding.SyntaxChecking;
15
using Rdmp.Core.Repositories;
16
using Rdmp.Core.ReusableLibraryCode.Checks;
17

18
namespace Rdmp.Core.DataExport.Data;
19

20
/// <summary>
21
/// Stores parameter values for a DeployedExtractionFilter e.g. @healthboard = 'T'
22
/// </summary>
23
public class DeployedExtractionFilterParameter : DatabaseEntity, ISqlParameter
24
{
25
    #region Database Properties
26

27
    private int _extractionFilter_ID;
28
    private string _parameterSQL;
29
    private string _value;
30
    private string _comment;
31

32
    /// <summary>
33
    /// The <see cref="ExtractionFilter"/> against which the parameter is declared.  The WHERE Sql of the filter should
34
    /// reference this parameter (e.g. "[mydb]..[mytbl].[hb_extract] = @healthboard").
35
    /// </summary>
36
    [Relationship(typeof(DeployedExtractionFilter), RelationshipType.SharedObject)]
37
    public int ExtractionFilter_ID
38
    {
39
        get => _extractionFilter_ID;
66✔
40
        set => SetField(ref _extractionFilter_ID, value);
60✔
41
    }
42

43
    /// <inheritdoc/>
44
    [Sql]
45
    public string ParameterSQL
46
    {
47
        get => _parameterSQL;
152✔
48
        set => SetField(ref _parameterSQL, value);
64✔
49
    }
50

51
    /// <inheritdoc/>
52
    [Sql]
53
    public string Value
54
    {
55
        get => _value;
162✔
56
        set => SetField(ref _value, value);
64✔
57
    }
58

59
    /// <inheritdoc/>
60
    public string Comment
61
    {
62
        get => _comment;
58✔
63
        set => SetField(ref _comment, value);
60✔
64
    }
65

66
    #endregion
67

68
    /// <inheritdoc/>
69
    [NoMappingToDatabase]
70
    public string ParameterName => QuerySyntaxHelper.GetParameterNameFromDeclarationSQL(ParameterSQL);
26✔
71

72
    #region Relationships
73

74
    /// <inheritdoc cref="ExtractionFilter_ID"/>
75
    [NoMappingToDatabase]
76
    public DeployedExtractionFilter ExtractionFilter =>
77
        Repository.GetObjectByID<DeployedExtractionFilter>(ExtractionFilter_ID);
2✔
78

79
    #endregion
80

81
    public DeployedExtractionFilterParameter()
×
82
    {
83
    }
×
84

85
    /// <summary>
86
    /// Creates a new parameter in the metadata database.
87
    /// </summary>
88
    /// <param name="repository"></param>
89
    /// <param name="parameterSQL">Declaration SQL for the parameter e.g. "DECLARE @bob as varchar(10)"</param>
90
    /// <param name="parent"></param>
91
    public DeployedExtractionFilterParameter(IDataExportRepository repository, string parameterSQL, IFilter parent)
16✔
92
    {
93
        Repository = repository;
16✔
94

95
        Repository.InsertAndHydrate(this, new Dictionary<string, object>
16✔
96
        {
16✔
97
            { "ParameterSQL", parameterSQL },
16✔
98
            { "ExtractionFilter_ID", parent.ID }
16✔
99
        });
16✔
100
    }
16✔
101

102
    /// <summary>
103
    /// Reads an existing parameter out of the database
104
    /// </summary>
105
    /// <param name="repository"></param>
106
    /// <param name="r"></param>
107
    internal DeployedExtractionFilterParameter(IDataExportRepository repository, DbDataReader r) : base(repository, r)
44✔
108
    {
109
        ExtractionFilter_ID = int.Parse(r["ExtractionFilter_ID"].ToString());
44✔
110
        ParameterSQL = r["ParameterSQL"] as string;
44✔
111
        Value = r["Value"] as string;
44✔
112
        Comment = r["Comment"] as string;
44✔
113
    }
44✔
114

115
    /// <summary>
116
    /// returns the <see cref="ParameterName"/>
117
    /// </summary>
118
    /// <returns></returns>
119
    public override string ToString() => $"{ParameterName} = {Value}";
×
120

121
    /// <summary>
122
    /// Checks the parameter syntax (See <see cref="ParameterSyntaxChecker"/>)
123
    /// </summary>
124
    /// <param name="notifier"></param>
125
    public void Check(ICheckNotifier notifier)
126
    {
127
        new ParameterSyntaxChecker(this).Check(notifier);
8✔
128
    }
8✔
129

130
    /// <inheritdoc/>
131
    public IQuerySyntaxHelper GetQuerySyntaxHelper() =>
132
        ((DeployedExtractionFilter)GetOwnerIfAny()).GetQuerySyntaxHelper();
16✔
133

134
    /// <inheritdoc/>
135
    public IMapsDirectlyToDatabaseTable GetOwnerIfAny() =>
136
        Repository.GetObjectByID<DeployedExtractionFilter>(ExtractionFilter_ID);
16✔
137

138
    public DeployedExtractionFilterParameter ShallowClone(DeployedExtractionFilter into)
139
    {
140
        var clone = new DeployedExtractionFilterParameter(DataExportRepository, ParameterSQL, into);
4✔
141
        CopyShallowValuesTo(clone);
4✔
142
        return clone;
4✔
143
    }
144
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc