-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
654 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**RDMP Version** | ||
Displayed in the task bar of the software e.g. v4.1.5 | ||
|
||
**Error with Stack Trace** | ||
``` | ||
If applicable, paste the entire stack trace here, leave the triple quotes (```) | ||
``` | ||
|
||
**Database Engine** | ||
Sql Server, Oracle, MySql or Postgres. | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
Rdmp.Core.Tests/CommandExecution/ExecuteCommandListTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright (c) The University of Dundee 2018-2019 | ||
// This file is part of the Research Data Management Platform (RDMP). | ||
// 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. | ||
// 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. | ||
// You should have received a copy of the GNU General Public License along with RDMP. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
using Moq; | ||
using NUnit.Framework; | ||
using Rdmp.Core.CommandExecution.AtomicCommands; | ||
using Rdmp.Core.CommandLine.Interactive.Picking; | ||
using Rdmp.Core.Curation.Data; | ||
using System.Text.RegularExpressions; | ||
|
||
namespace Rdmp.Core.Tests.CommandExecution | ||
{ | ||
class TestsExecuteCommandList : CommandCliTests | ||
{ | ||
[Test] | ||
public void Test_ExecuteCommandList_NoCataloguesParsing() | ||
{ | ||
foreach(var cat in RepositoryLocator.CatalogueRepository.GetAllObjects<Catalogue>()) | ||
cat.DeleteInDatabase(); | ||
|
||
Assert.IsEmpty(RepositoryLocator.CatalogueRepository.GetAllObjects<Catalogue>()); | ||
|
||
GetInvoker().ExecuteCommand(typeof(ExecuteCommandList), | ||
new CommandLineObjectPicker(new string[]{ "Catalogue"}, RepositoryLocator)); | ||
} | ||
|
||
[Test] | ||
public void Test_ExecuteCommandList_OneCatalogueParsing() | ||
{ | ||
var c = WhenIHaveA<Catalogue>(); | ||
|
||
GetInvoker().ExecuteCommand(typeof(ExecuteCommandList), | ||
new CommandLineObjectPicker(new string[]{ "Catalogue"}, RepositoryLocator)); | ||
|
||
c.DeleteInDatabase(); | ||
} | ||
[Test] | ||
public void Test_ExecuteCommandList_OneCatalogue() | ||
{ | ||
var c = WhenIHaveA<Catalogue>(); | ||
c.Name = "fff"; | ||
c.SaveToDatabase(); | ||
|
||
var mock = GetMockActivator(); | ||
|
||
var cmd = new ExecuteCommandList(mock.Object,new []{c}); | ||
Assert.IsFalse(cmd.IsImpossible,cmd.ReasonCommandImpossible); | ||
|
||
cmd.Execute(); | ||
|
||
string contents = Regex.Escape($"{c.ID}:fff"); | ||
|
||
// Called once | ||
mock.Verify(m => m.Show(It.IsRegex(contents)), Times.Once()); | ||
|
||
c.DeleteInDatabase(); | ||
} | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
Rdmp.Core.Tests/CommandExecution/TestExecuteCommandAssociateCatalogueWithLoadMetadata.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) The University of Dundee 2018-2019 | ||
// This file is part of the Research Data Management Platform (RDMP). | ||
// 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. | ||
// 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. | ||
// You should have received a copy of the GNU General Public License along with RDMP. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
using NUnit.Framework; | ||
using Rdmp.Core.CommandExecution.AtomicCommands; | ||
using Rdmp.Core.CommandLine.Interactive.Picking; | ||
using Rdmp.Core.Curation.Data; | ||
using Rdmp.Core.Curation.Data.DataLoad; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Rdmp.Core.Tests.CommandExecution | ||
{ | ||
class TestExecuteCommandAssociateCatalogueWithLoadMetadata : CommandCliTests | ||
{ | ||
|
||
[Test] | ||
public void TestExecuteCommandAssociateCatalogueWithLoadMetadata_Simple() | ||
{ | ||
var cata1 = new Catalogue(RepositoryLocator.CatalogueRepository,"fff"); | ||
var cata2 = new Catalogue(RepositoryLocator.CatalogueRepository,"bbb"); | ||
|
||
Assert.IsNull(cata1.LoadMetadata); | ||
Assert.IsNull(cata2.LoadMetadata); | ||
|
||
var lmd = new LoadMetadata(RepositoryLocator.CatalogueRepository,"mylmd"); | ||
|
||
GetInvoker().ExecuteCommand(typeof(ExecuteCommandAssociateCatalogueWithLoadMetadata), | ||
new CommandLineObjectPicker(new[]{$"LoadMetadata:{lmd.ID}", "Catalogue:fff"}, RepositoryLocator)); | ||
|
||
cata1.RevertToDatabaseState(); | ||
cata2.RevertToDatabaseState(); | ||
|
||
Assert.AreEqual(lmd.ID,cata1.LoadMetadata_ID); | ||
Assert.IsNull(cata2.LoadMetadata); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.