diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..9b68d7f
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,39 @@
+image: mcr.microsoft.com/dotnet/sdk:9.0
+
+stages:
+ - build
+ - test
+ - publish
+
+before_script:
+ - echo "Setting up environment"
+ - 'dotnet --version'
+
+build:
+ stage: build
+ script:
+ - dotnet restore
+ - dotnet build --configuration Release --no-restore
+ artifacts:
+ paths:
+ - "**/bin/Release"
+ expire_in: 10 minutes
+
+test:
+ stage: test
+ script:
+ - dotnet test --verbosity normal
+ dependencies:
+ - build
+
+publish:
+ stage: publish
+ script:
+ - export VERSION=$(echo $CI_COMMIT_TAG | sed 's/^v//')
+ - dotnet pack -c Release -o . /p:Version=$VERSION
+ - for nupkg in *.nupkg; do dotnet nuget push $nupkg -k ${NUGET_API_KEY} -s https://api.nuget.org/v3/index.json; done
+ only:
+ - tags
+ dependencies:
+ - build
+ - test
diff --git a/.idea/.idea.HopFrame/.idea/workspace.xml b/.idea/.idea.HopFrame/.idea/workspace.xml
index 0705f65..09e7fe9 100644
--- a/.idea/.idea.HopFrame/.idea/workspace.xml
+++ b/.idea/.idea.HopFrame/.idea/workspace.xml
@@ -9,17 +9,33 @@
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -39,7 +55,7 @@
@@ -67,18 +83,12 @@
+
-
-
-
-
-
-
-
-
+
{
@@ -92,24 +102,26 @@
- {
+ "keyToString": {
+ ".NET Launch Settings Profile.HopFrame.Testing.executor": "Run",
+ ".NET Launch Settings Profile.HopFrame.Testing: https.executor": "Run",
+ ".NET Project.HopFrame.Testing.executor": "Run",
+ "72b118b0-a6fc-4561-acdf-74f0b454dbb8.executor": "Debug",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "RunOnceActivity.git.unshallow": "true",
+ "dcdf1689-dc07-47e4-8824-2e60a4fbf301.executor": "Debug",
+ "git-widget-placeholder": "!18 on feature/unit-tests",
+ "list.type.of.created.stylesheet": "CSS",
+ "node.js.detected.package.eslint": "true",
+ "node.js.detected.package.tslint": "true",
+ "node.js.selected.package.eslint": "(autodetect)",
+ "node.js.selected.package.tslint": "(autodetect)",
+ "nodejs_package_manager_path": "npm",
+ "settings.editor.selected.configurable": "preferences.environmentSetup",
+ "vue.rearranger.settings.migration": "true"
}
-}]]>
+}
@@ -166,7 +178,10 @@
-
+
+
+
+
@@ -288,12 +303,77 @@
1737203441319
-
+
+
+ 1737208088933
+
+
+
+ 1737208088933
+
+
+
+ 1737212497960
+
+
+
+ 1737212497960
+
+
+
+ 1737285123218
+
+
+
+ 1737285123218
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -313,6 +393,9 @@
-
+
+
+
+
\ No newline at end of file
diff --git a/HopFrame.sln b/HopFrame.sln
index d622867..877f6af 100644
--- a/HopFrame.sln
+++ b/HopFrame.sln
@@ -10,6 +10,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Testing", "Testing", "{9EB7
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HopFrame.Testing", "testing\HopFrame.Testing\HopFrame.Testing.csproj", "{58490069-51DF-454C-8B54-7FB7D4BDFF81}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{141928CB-5977-4285-A986-5BD785F2883C}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HopFrame.Tests.Core", "tests\HopFrame.Tests.Core\HopFrame.Tests.Core.csproj", "{2E2D29E0-53FA-462D-B4D2-4678CD106E29}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HopFrame.Tests.Web", "tests\HopFrame.Tests.Web\HopFrame.Tests.Web.csproj", "{7AB4F4FF-E938-4A40-A7EB-7B2063262896}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -19,6 +25,8 @@ Global
{4BFE21C2-EAAC-4662-8B97-500836651B2A} = {7E4AAFB3-9762-4F42-86DF-5A3194FDC243}
{8E59F398-184A-47C9-AAA2-3E0FFD775ABF} = {7E4AAFB3-9762-4F42-86DF-5A3194FDC243}
{58490069-51DF-454C-8B54-7FB7D4BDFF81} = {9EB7FDBD-49C2-4872-9666-6F7AEBA541B2}
+ {2E2D29E0-53FA-462D-B4D2-4678CD106E29} = {141928CB-5977-4285-A986-5BD785F2883C}
+ {7AB4F4FF-E938-4A40-A7EB-7B2063262896} = {141928CB-5977-4285-A986-5BD785F2883C}
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4BFE21C2-EAAC-4662-8B97-500836651B2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -33,5 +41,13 @@ Global
{58490069-51DF-454C-8B54-7FB7D4BDFF81}.Debug|Any CPU.Build.0 = Debug|Any CPU
{58490069-51DF-454C-8B54-7FB7D4BDFF81}.Release|Any CPU.ActiveCfg = Release|Any CPU
{58490069-51DF-454C-8B54-7FB7D4BDFF81}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2E2D29E0-53FA-462D-B4D2-4678CD106E29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2E2D29E0-53FA-462D-B4D2-4678CD106E29}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2E2D29E0-53FA-462D-B4D2-4678CD106E29}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2E2D29E0-53FA-462D-B4D2-4678CD106E29}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7AB4F4FF-E938-4A40-A7EB-7B2063262896}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7AB4F4FF-E938-4A40-A7EB-7B2063262896}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7AB4F4FF-E938-4A40-A7EB-7B2063262896}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7AB4F4FF-E938-4A40-A7EB-7B2063262896}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
diff --git a/src/HopFrame.Core/Config/DbContextConfigurator.cs b/src/HopFrame.Core/Config/DbContextConfig.cs
similarity index 100%
rename from src/HopFrame.Core/Config/DbContextConfigurator.cs
rename to src/HopFrame.Core/Config/DbContextConfig.cs
diff --git a/src/HopFrame.Core/Config/HopFrameConfig.cs b/src/HopFrame.Core/Config/HopFrameConfig.cs
index 1bf8227..732d367 100644
--- a/src/HopFrame.Core/Config/HopFrameConfig.cs
+++ b/src/HopFrame.Core/Config/HopFrameConfig.cs
@@ -1,5 +1,4 @@
-using HopFrame.Core.Services;
-using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore;
namespace HopFrame.Core.Config;
diff --git a/src/HopFrame.Core/Config/PropertyConfigurator.cs b/src/HopFrame.Core/Config/PropertyConfig.cs
similarity index 97%
rename from src/HopFrame.Core/Config/PropertyConfigurator.cs
rename to src/HopFrame.Core/Config/PropertyConfig.cs
index 9058c45..5322a37 100644
--- a/src/HopFrame.Core/Config/PropertyConfigurator.cs
+++ b/src/HopFrame.Core/Config/PropertyConfig.cs
@@ -1,5 +1,4 @@
-using System.Collections;
-using System.Linq.Expressions;
+using System.Linq.Expressions;
using System.Reflection;
namespace HopFrame.Core.Config;
@@ -21,9 +20,9 @@ public class PropertyConfig(PropertyInfo info, TableConfig table, int nthPropert
public bool DisplayValue { get; set; } = true;
public bool TextArea { get; set; }
public int TextAreaRows { get; set; } = 16;
- public bool IsRelation { get; set; }
- public bool IsRequired { get; set; }
- public bool IsEnumerable { get; set; }
+ public bool IsRelation { get; internal set; }
+ public bool IsRequired { get; internal set; }
+ public bool IsEnumerable { get; internal set; }
public bool IsListingProperty { get; set; }
public int Order { get; set; } = nthProperty;
}
diff --git a/src/HopFrame.Core/Config/TableConfigurator.cs b/src/HopFrame.Core/Config/TableConfig.cs
similarity index 97%
rename from src/HopFrame.Core/Config/TableConfigurator.cs
rename to src/HopFrame.Core/Config/TableConfig.cs
index c85c32a..6a5ad7c 100644
--- a/src/HopFrame.Core/Config/TableConfigurator.cs
+++ b/src/HopFrame.Core/Config/TableConfig.cs
@@ -99,10 +99,11 @@ public class TableConfigurator(TableConfig config) {
/// The configurator for the virtual property
///
public PropertyConfigurator AddVirtualProperty(string name, Func template) {
- var prop = new PropertyConfig(InnerConfig.Properties.First().Info, InnerConfig, InnerConfig.Properties.Count);
- prop.Name = name;
- prop.IsListingProperty = true;
- prop.Formatter = (obj, provider) => template.Invoke((TModel)obj, provider);
+ var prop = new PropertyConfig(InnerConfig.Properties.First().Info, InnerConfig, InnerConfig.Properties.Count) {
+ Name = name,
+ IsListingProperty = true,
+ Formatter = (obj, provider) => template.Invoke((TModel)obj, provider)
+ };
InnerConfig.Properties.Add(prop);
return new PropertyConfigurator(prop);
}
diff --git a/src/HopFrame.Core/HopFrame.Core.csproj b/src/HopFrame.Core/HopFrame.Core.csproj
index ae907a6..4056565 100644
--- a/src/HopFrame.Core/HopFrame.Core.csproj
+++ b/src/HopFrame.Core/HopFrame.Core.csproj
@@ -10,4 +10,10 @@
+
+
+ <_Parameter1>HopFrame.Tests.Core
+
+
+
diff --git a/src/HopFrame.Core/Services/Implementations/TableManager.cs b/src/HopFrame.Core/Services/Implementations/TableManager.cs
index 33c74e7..d682af9 100644
--- a/src/HopFrame.Core/Services/Implementations/TableManager.cs
+++ b/src/HopFrame.Core/Services/Implementations/TableManager.cs
@@ -9,7 +9,7 @@ internal sealed class TableManager(DbContext context, TableConfig config
public IQueryable