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

HicServices / RDMP / 19852309549

02 Dec 2025 08:38AM UTC coverage: 55.8% (-1.4%) from 57.197%
19852309549

Pull #2279

github

JFriel
fix build
Pull Request #2279: [UI Overhaul] Spike/refresh

11249 of 21727 branches covered (51.77%)

Branch coverage included in aggregate %.

807 of 1108 new or added lines in 29 files covered. (72.83%)

724 existing lines in 67 files now uncovered.

31893 of 55588 relevant lines covered (57.37%)

16683.65 hits per line

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

94.44
/Rdmp.Core/DataLoad/Engine/Pipeline/UploadFileUseCase.cs
1
// Copyright (c) The University of Dundee 2018-2019
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.Data;
8
using System.IO;
9
using FAnsi.Discovery;
10
using Rdmp.Core.CommandExecution;
11
using Rdmp.Core.Curation.Data.Pipelines;
12
using Rdmp.Core.DataFlowPipeline.Requirements;
13
using Rdmp.Core.DataLoad.Engine.Pipeline.Destinations;
14

15
namespace Rdmp.Core.DataLoad.Engine.Pipeline;
16

17
/// <summary>
18
/// Describes the use case of uploading a <see cref="FileInfo"/> to a target database server.  Compatible pipelines for achieving this must have a destination
19
/// of (or inheriting from) <see cref="DataTableUploadDestination"/> and a source that implements IPipelineRequirement&lt;FlatFileToLoad&gt;.
20
/// </summary>
21
public sealed class UploadFileUseCase : PipelineUseCase
22
{
23
    public UploadFileUseCase(FileInfo file, DiscoveredDatabase targetDatabase, IBasicActivateItems activator)
22✔
24
    {
25
        AddInitializationObject(new FlatFileToLoad(file));
22✔
26
        AddInitializationObject(targetDatabase);
22✔
27
        AddInitializationObject(activator);
22✔
28

29
        GenerateContext();
22✔
30
    }
22✔
31

32
    protected override IDataFlowPipelineContext GenerateContextImpl()
33
    {
34
        var context = new DataFlowPipelineContextFactory<DataTable>().Create(PipelineUsage.LoadsSingleFlatFile);
26✔
35
        context.MustHaveDestination = typeof(DataTableUploadDestination);
26✔
36
        return context;
26✔
37
    }
38

39
    public UploadFileUseCase() : base(new[]
4✔
40
    {
4✔
41
        typeof(FlatFileToLoad),
4✔
42
        typeof(DiscoveredDatabase),
4✔
43
        typeof(IBasicActivateItems)
4✔
44
    })
4✔
45
    {
46
        GenerateContext();
4✔
47
    }
4✔
48

UNCOV
49
    public static PipelineUseCase DesignTime() => new UploadFileUseCase();
×
50
}
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

© 2025 Coveralls, Inc