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

HicServices / RDMP / 19465055827

18 Nov 2025 11:47AM UTC coverage: 57.142% (+0.05%) from 57.097%
19465055827

push

github

web-flow
Merge pull request #2260 from HicServices/task/RDMP-342-cic-templates

Task/rdmp-342 CIC Templates

11472 of 21559 branches covered (53.21%)

Branch coverage included in aggregate %.

1000 of 1215 new or added lines in 34 files covered. (82.3%)

2 existing lines in 2 files now uncovered.

32516 of 55421 relevant lines covered (58.67%)

8798.98 hits per line

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

0.0
/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandMoveContainerIntoContainer.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 Rdmp.Core.CommandExecution.Combining;
8
using Rdmp.Core.Curation.Data;
9
using Rdmp.Core.Repositories.Construction;
10

11
namespace Rdmp.Core.CommandExecution.AtomicCommands;
12

13
public class ExecuteCommandMoveContainerIntoContainer : BasicCommandExecution
14
{
15
    private readonly ContainerCombineable _containerCombineable;
16
    private readonly IContainer _targetContainer;
17

18
    [UseWithObjectConstructor]
19
    public ExecuteCommandMoveContainerIntoContainer(IBasicActivateItems activator, IContainer toMove, IContainer into)
20
        : this(activator, new ContainerCombineable(toMove), into)
×
21
    {
22
    }
×
23

24
    public ExecuteCommandMoveContainerIntoContainer(IBasicActivateItems activator,
25
        ContainerCombineable containerCombineable, IContainer targetContainer) : base(activator)
×
26
    {
27
        _containerCombineable = containerCombineable;
×
28
        _targetContainer = targetContainer;
×
29

30
        if (containerCombineable.AllSubContainersRecursive.Contains(targetContainer))
×
31
            SetImpossible("You cannot move a container (AND/OR) into one of its own subcontainers");
×
32

NEW
33
        if (targetContainer.ShouldBeReadOnly(this.GetType().Name, out var reason))
×
34
            SetImpossible(reason);
×
35
    }
×
36

37
    public override void Execute()
38
    {
39
        base.Execute();
×
40

41
        _containerCombineable.Container.MakeIntoAnOrphan();
×
42
        _targetContainer.AddChild(_containerCombineable.Container);
×
43
        Publish((DatabaseEntity)_targetContainer);
×
44
    }
×
45
}
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