Browse Source

Moved to final location.

pull/315/head
Sebastian Stehle 7 years ago
parent
commit
3b9d2ed4ac
  1. 30
      Squidex.sln
  2. 2
      extensions/Squidex.Extensions/Actions/Algolia/AlgoliaAction.cs
  3. 2
      extensions/Squidex.Extensions/Actions/Algolia/AlgoliaActionHandler.cs
  4. 2
      extensions/Squidex.Extensions/Actions/AzureQueue/AzureQueueAction.cs
  5. 2
      extensions/Squidex.Extensions/Actions/AzureQueue/AzureQueueActionHandler.cs
  6. 2
      extensions/Squidex.Extensions/Actions/ClientPool.cs
  7. 2
      extensions/Squidex.Extensions/Actions/Discourse/DiscourseAction.cs
  8. 2
      extensions/Squidex.Extensions/Actions/Discourse/DiscourseActionHandler.cs
  9. 2
      extensions/Squidex.Extensions/Actions/ElasticSearch/ElasticSearchAction.cs
  10. 2
      extensions/Squidex.Extensions/Actions/ElasticSearch/ElasticSearchActionHandler.cs
  11. 2
      extensions/Squidex.Extensions/Actions/Fastly/FastlyAction.cs
  12. 2
      extensions/Squidex.Extensions/Actions/Fastly/FastlyActionHandler.cs
  13. 0
      extensions/Squidex.Extensions/Actions/HttpHelper.cs
  14. 2
      extensions/Squidex.Extensions/Actions/Medium/MediumAction.cs
  15. 2
      extensions/Squidex.Extensions/Actions/Medium/MediumActionHandler.cs
  16. 2
      extensions/Squidex.Extensions/Actions/RuleActionAttribute.cs
  17. 3
      extensions/Squidex.Extensions/Actions/RuleActionHandlerAttribute.cs
  18. 2
      extensions/Squidex.Extensions/Actions/RuleElement.cs
  19. 2
      extensions/Squidex.Extensions/Actions/RuleElementRegistry.cs
  20. 2
      extensions/Squidex.Extensions/Actions/Slack/SlackAction.cs
  21. 2
      extensions/Squidex.Extensions/Actions/Slack/SlackActionHandler.cs
  22. 2
      extensions/Squidex.Extensions/Actions/Twitter/TweetAction.cs
  23. 2
      extensions/Squidex.Extensions/Actions/Twitter/TweetActionHandler.cs
  24. 2
      extensions/Squidex.Extensions/Actions/Twitter/TwitterOptions.cs
  25. 2
      extensions/Squidex.Extensions/Actions/WebhookAction/WebhookAction.cs
  26. 2
      extensions/Squidex.Extensions/Actions/WebhookAction/WebhookActionHandler.cs
  27. 4
      extensions/Squidex.Extensions/Squidex.Extensions.csproj
  28. 2
      src/Squidex/AppServices.cs
  29. 2
      src/Squidex/Areas/Api/Controllers/Rules/Models/RuleActionProcessor.cs
  30. 2
      src/Squidex/Areas/Api/Controllers/Rules/Models/RuleActionSerializer.cs
  31. 2
      src/Squidex/Areas/Api/Controllers/Rules/RulesController.cs
  32. 2
      src/Squidex/Areas/Api/Controllers/Rules/TwitterController.cs
  33. 2
      src/Squidex/Areas/Api/Controllers/UI/UIController.cs
  34. 2
      src/Squidex/Config/Domain/RuleServices.cs
  35. 2
      src/Squidex/Config/Domain/SerializationServices.cs
  36. 2
      src/Squidex/Squidex.csproj
  37. 70
      tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/Actions/AlgoliaActionTests.cs
  38. 70
      tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/Actions/AzureQueueActionTests.cs
  39. 85
      tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/Actions/ElasticSearchActionTests.cs
  40. 56
      tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/Actions/FastlyActionTests.cs
  41. 70
      tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/Actions/MediumActionTests.cs
  42. 71
      tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/Actions/SlackActionTests.cs
  43. 70
      tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/Actions/TweetActionTests.cs
  44. 57
      tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/Actions/WebhookActionTests.cs
  45. 1
      tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj

30
Squidex.sln

@ -63,10 +63,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Migrate_01", "tools\Migrate
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Squidex.Tests", "tests\Squidex.Tests\Squidex.Tests.csproj", "{7E8CC864-4C6E-496F-A672-9F9AD8874835}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Squidex.Tests", "tests\Squidex.Tests\Squidex.Tests.csproj", "{7E8CC864-4C6E-496F-A672-9F9AD8874835}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Squidex.Domain.Apps.Rules", "src\Squidex.Domain.Apps.Rules\Squidex.Domain.Apps.Rules.csproj", "{99B4B165-9146-4406-87AA-A6CD722E33D6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "extensions", "extensions", "{FB8BC3A2-2010-4C3C-A87D-D4A98C05EE52}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "extensions", "extensions", "{FB8BC3A2-2010-4C3C-A87D-D4A98C05EE52}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Squidex.Extensions", "extensions\Squidex.Extensions\Squidex.Extensions.csproj", "{F3C41B82-6A67-409A-B7FE-54543EE4F38B}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -325,18 +325,18 @@ Global
{7E8CC864-4C6E-496F-A672-9F9AD8874835}.Release|x64.Build.0 = Release|Any CPU {7E8CC864-4C6E-496F-A672-9F9AD8874835}.Release|x64.Build.0 = Release|Any CPU
{7E8CC864-4C6E-496F-A672-9F9AD8874835}.Release|x86.ActiveCfg = Release|Any CPU {7E8CC864-4C6E-496F-A672-9F9AD8874835}.Release|x86.ActiveCfg = Release|Any CPU
{7E8CC864-4C6E-496F-A672-9F9AD8874835}.Release|x86.Build.0 = Release|Any CPU {7E8CC864-4C6E-496F-A672-9F9AD8874835}.Release|x86.Build.0 = Release|Any CPU
{99B4B165-9146-4406-87AA-A6CD722E33D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F3C41B82-6A67-409A-B7FE-54543EE4F38B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{99B4B165-9146-4406-87AA-A6CD722E33D6}.Debug|Any CPU.Build.0 = Debug|Any CPU {F3C41B82-6A67-409A-B7FE-54543EE4F38B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{99B4B165-9146-4406-87AA-A6CD722E33D6}.Debug|x64.ActiveCfg = Debug|Any CPU {F3C41B82-6A67-409A-B7FE-54543EE4F38B}.Debug|x64.ActiveCfg = Debug|Any CPU
{99B4B165-9146-4406-87AA-A6CD722E33D6}.Debug|x64.Build.0 = Debug|Any CPU {F3C41B82-6A67-409A-B7FE-54543EE4F38B}.Debug|x64.Build.0 = Debug|Any CPU
{99B4B165-9146-4406-87AA-A6CD722E33D6}.Debug|x86.ActiveCfg = Debug|Any CPU {F3C41B82-6A67-409A-B7FE-54543EE4F38B}.Debug|x86.ActiveCfg = Debug|Any CPU
{99B4B165-9146-4406-87AA-A6CD722E33D6}.Debug|x86.Build.0 = Debug|Any CPU {F3C41B82-6A67-409A-B7FE-54543EE4F38B}.Debug|x86.Build.0 = Debug|Any CPU
{99B4B165-9146-4406-87AA-A6CD722E33D6}.Release|Any CPU.ActiveCfg = Release|Any CPU {F3C41B82-6A67-409A-B7FE-54543EE4F38B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{99B4B165-9146-4406-87AA-A6CD722E33D6}.Release|Any CPU.Build.0 = Release|Any CPU {F3C41B82-6A67-409A-B7FE-54543EE4F38B}.Release|Any CPU.Build.0 = Release|Any CPU
{99B4B165-9146-4406-87AA-A6CD722E33D6}.Release|x64.ActiveCfg = Release|Any CPU {F3C41B82-6A67-409A-B7FE-54543EE4F38B}.Release|x64.ActiveCfg = Release|Any CPU
{99B4B165-9146-4406-87AA-A6CD722E33D6}.Release|x64.Build.0 = Release|Any CPU {F3C41B82-6A67-409A-B7FE-54543EE4F38B}.Release|x64.Build.0 = Release|Any CPU
{99B4B165-9146-4406-87AA-A6CD722E33D6}.Release|x86.ActiveCfg = Release|Any CPU {F3C41B82-6A67-409A-B7FE-54543EE4F38B}.Release|x86.ActiveCfg = Release|Any CPU
{99B4B165-9146-4406-87AA-A6CD722E33D6}.Release|x86.Build.0 = Release|Any CPU {F3C41B82-6A67-409A-B7FE-54543EE4F38B}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -365,7 +365,7 @@ Global
{AA003372-CD8D-4DBC-962C-F61E0C93CF05} = {C9809D59-6665-471E-AD87-5AC624C65892} {AA003372-CD8D-4DBC-962C-F61E0C93CF05} = {C9809D59-6665-471E-AD87-5AC624C65892}
{7DA5B308-D950-4496-93D5-21D6C4D91644} = {C9809D59-6665-471E-AD87-5AC624C65892} {7DA5B308-D950-4496-93D5-21D6C4D91644} = {C9809D59-6665-471E-AD87-5AC624C65892}
{A4823E14-C0E5-4A4D-B28F-27424C25C3C7} = {94207AA6-4923-4183-A558-E0F8196B8CA3} {A4823E14-C0E5-4A4D-B28F-27424C25C3C7} = {94207AA6-4923-4183-A558-E0F8196B8CA3}
{99B4B165-9146-4406-87AA-A6CD722E33D6} = {FB8BC3A2-2010-4C3C-A87D-D4A98C05EE52} {F3C41B82-6A67-409A-B7FE-54543EE4F38B} = {FB8BC3A2-2010-4C3C-A87D-D4A98C05EE52}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {02F2E872-3141-44F5-BD6A-33CD84E9FE08} SolutionGuid = {02F2E872-3141-44F5-BD6A-33CD84E9FE08}

2
src/Squidex.Domain.Apps.Rules/Actions/Algolia/AlgoliaAction.cs → extensions/Squidex.Extensions/Actions/Algolia/AlgoliaAction.cs

@ -9,7 +9,7 @@ using System.ComponentModel.DataAnnotations;
using Squidex.Domain.Apps.Core.HandleRules; using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules; using Squidex.Domain.Apps.Core.Rules;
namespace Squidex.Domain.Apps.Rules.Action.Algolia namespace Squidex.Extensions.Actions.Algolia
{ {
[RuleActionHandler(typeof(AlgoliaActionHandler))] [RuleActionHandler(typeof(AlgoliaActionHandler))]
[RuleAction(Link = "https://www.algolia.com/", [RuleAction(Link = "https://www.algolia.com/",

2
src/Squidex.Domain.Apps.Rules/Actions/Algolia/AlgoliaActionHandler.cs → extensions/Squidex.Extensions/Actions/Algolia/AlgoliaActionHandler.cs

@ -13,7 +13,7 @@ using Newtonsoft.Json.Linq;
using Squidex.Domain.Apps.Core.HandleRules; using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.HandleRules.EnrichedEvents; using Squidex.Domain.Apps.Core.HandleRules.EnrichedEvents;
namespace Squidex.Domain.Apps.Rules.Action.Algolia namespace Squidex.Extensions.Actions.Algolia
{ {
public sealed class AlgoliaActionHandler : RuleActionHandler<AlgoliaAction, AlgoliaJob> public sealed class AlgoliaActionHandler : RuleActionHandler<AlgoliaAction, AlgoliaJob>
{ {

2
src/Squidex.Domain.Apps.Rules/Actions/AzureQueue/AzureQueueAction.cs → extensions/Squidex.Extensions/Actions/AzureQueue/AzureQueueAction.cs

@ -12,7 +12,7 @@ using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules; using Squidex.Domain.Apps.Core.Rules;
using Squidex.Infrastructure; using Squidex.Infrastructure;
namespace Squidex.Domain.Apps.Rules.Action.AzureQueue namespace Squidex.Extensions.Actions.AzureQueue
{ {
[RuleActionHandler(typeof(AzureQueueActionHandler))] [RuleActionHandler(typeof(AzureQueueActionHandler))]
[RuleAction(Link = "https://azure.microsoft.com/en-us/services/storage/queues/", [RuleAction(Link = "https://azure.microsoft.com/en-us/services/storage/queues/",

2
src/Squidex.Domain.Apps.Rules/Actions/AzureQueue/AzureQueueActionHandler.cs → extensions/Squidex.Extensions/Actions/AzureQueue/AzureQueueActionHandler.cs

@ -12,7 +12,7 @@ using Microsoft.WindowsAzure.Storage.Queue;
using Squidex.Domain.Apps.Core.HandleRules; using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.HandleRules.EnrichedEvents; using Squidex.Domain.Apps.Core.HandleRules.EnrichedEvents;
namespace Squidex.Domain.Apps.Rules.Action.AzureQueue namespace Squidex.Extensions.Actions.AzureQueue
{ {
public sealed class AzureQueueActionHandler : RuleActionHandler<AzureQueueAction, AzureQueueJob> public sealed class AzureQueueActionHandler : RuleActionHandler<AzureQueueAction, AzureQueueJob>
{ {

2
src/Squidex.Domain.Apps.Rules/Actions/ClientPool.cs → extensions/Squidex.Extensions/Actions/ClientPool.cs

@ -12,7 +12,7 @@ using Microsoft.Extensions.Options;
#pragma warning disable RECS0108 // Warns about static fields in generic types #pragma warning disable RECS0108 // Warns about static fields in generic types
namespace Squidex.Domain.Apps.Rules.Action namespace Squidex.Extensions.Actions
{ {
internal sealed class ClientPool<TKey, TClient> internal sealed class ClientPool<TKey, TClient>
{ {

2
src/Squidex.Domain.Apps.Rules/Actions/Discourse/DiscourseAction.cs → extensions/Squidex.Extensions/Actions/Discourse/DiscourseAction.cs

@ -11,7 +11,7 @@ using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules; using Squidex.Domain.Apps.Core.Rules;
using Squidex.Infrastructure; using Squidex.Infrastructure;
namespace Squidex.Domain.Apps.Rules.Actions.Discourse namespace Squidex.Extensions.Actions.Discourse
{ {
[RuleActionHandler(typeof(DiscourseActionHandler))] [RuleActionHandler(typeof(DiscourseActionHandler))]
[RuleAction(Description = "")] [RuleAction(Description = "")]

2
src/Squidex.Domain.Apps.Rules/Actions/Discourse/DiscourseActionHandler.cs → extensions/Squidex.Extensions/Actions/Discourse/DiscourseActionHandler.cs

@ -11,7 +11,7 @@ using System.Threading.Tasks;
using Squidex.Domain.Apps.Core.HandleRules; using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.HandleRules.EnrichedEvents; using Squidex.Domain.Apps.Core.HandleRules.EnrichedEvents;
namespace Squidex.Domain.Apps.Rules.Actions.Discourse namespace Squidex.Extensions.Actions.Discourse
{ {
public sealed class DiscourseActionHandler : RuleActionHandler<DiscourseAction, DiscourseJob> public sealed class DiscourseActionHandler : RuleActionHandler<DiscourseAction, DiscourseJob>
{ {

2
src/Squidex.Domain.Apps.Rules/Actions/ElasticSearch/ElasticSearchAction.cs → extensions/Squidex.Extensions/Actions/ElasticSearch/ElasticSearchAction.cs

@ -11,7 +11,7 @@ using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules; using Squidex.Domain.Apps.Core.Rules;
using Squidex.Infrastructure; using Squidex.Infrastructure;
namespace Squidex.Domain.Apps.Rules.Action.ElasticSearch namespace Squidex.Extensions.Actions.ElasticSearch
{ {
[RuleActionHandler(typeof(ElasticSearchActionHandler))] [RuleActionHandler(typeof(ElasticSearchActionHandler))]
[RuleAction(Link = "https://www.elastic.co/", [RuleAction(Link = "https://www.elastic.co/",

2
src/Squidex.Domain.Apps.Rules/Actions/ElasticSearch/ElasticSearchActionHandler.cs → extensions/Squidex.Extensions/Actions/ElasticSearch/ElasticSearchActionHandler.cs

@ -12,7 +12,7 @@ using Newtonsoft.Json.Linq;
using Squidex.Domain.Apps.Core.HandleRules; using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.HandleRules.EnrichedEvents; using Squidex.Domain.Apps.Core.HandleRules.EnrichedEvents;
namespace Squidex.Domain.Apps.Rules.Action.ElasticSearch namespace Squidex.Extensions.Actions.ElasticSearch
{ {
public sealed class ElasticSearchActionHandler : RuleActionHandler<ElasticSearchAction, ElasticSearchJob> public sealed class ElasticSearchActionHandler : RuleActionHandler<ElasticSearchAction, ElasticSearchJob>
{ {

2
src/Squidex.Domain.Apps.Rules/Actions/Fastly/FastlyAction.cs → extensions/Squidex.Extensions/Actions/Fastly/FastlyAction.cs

@ -9,7 +9,7 @@ using System.ComponentModel.DataAnnotations;
using Squidex.Domain.Apps.Core.HandleRules; using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules; using Squidex.Domain.Apps.Core.Rules;
namespace Squidex.Domain.Apps.Rules.Action.Fastly namespace Squidex.Extensions.Actions.Fastly
{ {
[RuleActionHandler(typeof(FastlyActionHandler))] [RuleActionHandler(typeof(FastlyActionHandler))]
[RuleAction(Link = "https://www.fastly.com/", [RuleAction(Link = "https://www.fastly.com/",

2
src/Squidex.Domain.Apps.Rules/Actions/Fastly/FastlyActionHandler.cs → extensions/Squidex.Extensions/Actions/Fastly/FastlyActionHandler.cs

@ -13,7 +13,7 @@ using Squidex.Domain.Apps.Core.HandleRules.Actions.Utils;
using Squidex.Domain.Apps.Core.HandleRules.EnrichedEvents; using Squidex.Domain.Apps.Core.HandleRules.EnrichedEvents;
using Squidex.Infrastructure; using Squidex.Infrastructure;
namespace Squidex.Domain.Apps.Rules.Action.Fastly namespace Squidex.Extensions.Actions.Fastly
{ {
public sealed class FastlyActionHandler : RuleActionHandler<FastlyAction, FastlyJob> public sealed class FastlyActionHandler : RuleActionHandler<FastlyAction, FastlyJob>
{ {

0
src/Squidex.Domain.Apps.Rules/Actions/HttpHelper.cs → extensions/Squidex.Extensions/Actions/HttpHelper.cs

2
src/Squidex.Domain.Apps.Rules/Actions/Medium/MediumAction.cs → extensions/Squidex.Extensions/Actions/Medium/MediumAction.cs

@ -9,7 +9,7 @@ using System.ComponentModel.DataAnnotations;
using Squidex.Domain.Apps.Core.HandleRules; using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules; using Squidex.Domain.Apps.Core.Rules;
namespace Squidex.Domain.Apps.Rules.Action.Medium namespace Squidex.Extensions.Actions.Medium
{ {
[RuleActionHandler(typeof(MediumActionHandler))] [RuleActionHandler(typeof(MediumActionHandler))]
[RuleAction(Link = "https://medium.com/", [RuleAction(Link = "https://medium.com/",

2
src/Squidex.Domain.Apps.Rules/Actions/Medium/MediumActionHandler.cs → extensions/Squidex.Extensions/Actions/Medium/MediumActionHandler.cs

@ -19,7 +19,7 @@ using Squidex.Infrastructure.Http;
#pragma warning disable SA1649 // File name must match first type name #pragma warning disable SA1649 // File name must match first type name
namespace Squidex.Domain.Apps.Rules.Action.Medium namespace Squidex.Extensions.Actions.Medium
{ {
public sealed class MediumJob public sealed class MediumJob
{ {

2
src/Squidex.Domain.Apps.Rules/Actions/RuleActionAttribute.cs → extensions/Squidex.Extensions/Actions/RuleActionAttribute.cs

@ -7,7 +7,7 @@
using System; using System;
namespace Squidex.Domain.Apps.Rules.Actions namespace Squidex.Extensions.Actions
{ {
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class RuleActionAttribute : Attribute public sealed class RuleActionAttribute : Attribute

3
src/Squidex.Domain.Apps.Rules/Actions/RuleActionHandlerAttribute.cs → extensions/Squidex.Extensions/Actions/RuleActionHandlerAttribute.cs

@ -6,9 +6,10 @@
// ========================================================================== // ==========================================================================
using System; using System;
using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Infrastructure; using Squidex.Infrastructure;
namespace Squidex.Domain.Apps.Rules.Actions namespace Squidex.Extensions.Actions
{ {
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
public sealed class RuleActionHandlerAttribute : Attribute public sealed class RuleActionHandlerAttribute : Attribute

2
src/Squidex.Domain.Apps.Rules/Actions/RuleElement.cs → extensions/Squidex.Extensions/Actions/RuleElement.cs

@ -7,7 +7,7 @@
using System; using System;
namespace Squidex.Domain.Apps.Rules.Actions namespace Squidex.Extensions.Actions
{ {
public sealed class RuleElement public sealed class RuleElement
{ {

2
src/Squidex.Domain.Apps.Rules/Actions/RuleElementRegistry.cs → extensions/Squidex.Extensions/Actions/RuleElementRegistry.cs

@ -14,7 +14,7 @@ using Squidex.Domain.Apps.Core.Rules;
using Squidex.Domain.Apps.Core.Rules.Triggers; using Squidex.Domain.Apps.Core.Rules.Triggers;
using Squidex.Infrastructure; using Squidex.Infrastructure;
namespace Squidex.Domain.Apps.Rules.Actions namespace Squidex.Extensions.Actions
{ {
public static class RuleElementRegistry public static class RuleElementRegistry
{ {

2
src/Squidex.Domain.Apps.Rules/Actions/Slack/SlackAction.cs → extensions/Squidex.Extensions/Actions/Slack/SlackAction.cs

@ -11,7 +11,7 @@ using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules; using Squidex.Domain.Apps.Core.Rules;
using Squidex.Infrastructure; using Squidex.Infrastructure;
namespace Squidex.Domain.Apps.Rules.Action.Slack namespace Squidex.Extensions.Actions.Slack
{ {
[RuleActionHandler(typeof(SlackActionHandler))] [RuleActionHandler(typeof(SlackActionHandler))]
[RuleAction(Link = "https://slack.com", [RuleAction(Link = "https://slack.com",

2
src/Squidex.Domain.Apps.Rules/Actions/Slack/SlackActionHandler.cs → extensions/Squidex.Extensions/Actions/Slack/SlackActionHandler.cs

@ -16,7 +16,7 @@ using Squidex.Domain.Apps.Core.HandleRules.Actions.Utils;
using Squidex.Domain.Apps.Core.HandleRules.EnrichedEvents; using Squidex.Domain.Apps.Core.HandleRules.EnrichedEvents;
using Squidex.Infrastructure; using Squidex.Infrastructure;
namespace Squidex.Domain.Apps.Rules.Action.Slack namespace Squidex.Extensions.Actions.Slack
{ {
public sealed class SlackActionHandler : RuleActionHandler<SlackAction, SlackJob> public sealed class SlackActionHandler : RuleActionHandler<SlackAction, SlackJob>
{ {

2
src/Squidex.Domain.Apps.Rules/Actions/Twitter/TweetAction.cs → extensions/Squidex.Extensions/Actions/Twitter/TweetAction.cs

@ -9,7 +9,7 @@ using System.ComponentModel.DataAnnotations;
using Squidex.Domain.Apps.Core.HandleRules; using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules; using Squidex.Domain.Apps.Core.Rules;
namespace Squidex.Domain.Apps.Rules.Action.Twitter namespace Squidex.Extensions.Actions.Twitter
{ {
[RuleActionHandler(typeof(TweetActionHandler))] [RuleActionHandler(typeof(TweetActionHandler))]
[RuleAction(Link = "https://twitter.com", [RuleAction(Link = "https://twitter.com",

2
src/Squidex.Domain.Apps.Rules/Actions/Twitter/TweetActionHandler.cs → extensions/Squidex.Extensions/Actions/Twitter/TweetActionHandler.cs

@ -13,7 +13,7 @@ using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.HandleRules.EnrichedEvents; using Squidex.Domain.Apps.Core.HandleRules.EnrichedEvents;
using Squidex.Infrastructure; using Squidex.Infrastructure;
namespace Squidex.Domain.Apps.Rules.Action.Twitter namespace Squidex.Extensions.Actions.Twitter
{ {
public sealed class TweetActionHandler : RuleActionHandler<TweetAction, TweetJob> public sealed class TweetActionHandler : RuleActionHandler<TweetAction, TweetJob>
{ {

2
src/Squidex.Domain.Apps.Rules/Actions/Twitter/TwitterOptions.cs → extensions/Squidex.Extensions/Actions/Twitter/TwitterOptions.cs

@ -5,7 +5,7 @@
// All rights reserved. Licensed under the MIT license. // All rights reserved. Licensed under the MIT license.
// ========================================================================== // ==========================================================================
namespace Squidex.Domain.Apps.Rules.Action.Twitter namespace Squidex.Extensions.Actions.Twitter
{ {
public sealed class TwitterOptions public sealed class TwitterOptions
{ {

2
src/Squidex.Domain.Apps.Rules/Actions/WebhookAction/WebhookAction.cs → extensions/Squidex.Extensions/Actions/WebhookAction/WebhookAction.cs

@ -11,7 +11,7 @@ using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.Rules; using Squidex.Domain.Apps.Core.Rules;
using Squidex.Infrastructure; using Squidex.Infrastructure;
namespace Squidex.Domain.Apps.Rules.Action.Webhook namespace Squidex.Extensions.Actions.Webhook
{ {
[RuleActionHandler(typeof(WebhookActionHandler))] [RuleActionHandler(typeof(WebhookActionHandler))]
[RuleAction( [RuleAction(

2
src/Squidex.Domain.Apps.Rules/Actions/WebhookAction/WebhookActionHandler.cs → extensions/Squidex.Extensions/Actions/WebhookAction/WebhookActionHandler.cs

@ -14,7 +14,7 @@ using Squidex.Domain.Apps.Core.HandleRules.Actions.Utils;
using Squidex.Domain.Apps.Core.HandleRules.EnrichedEvents; using Squidex.Domain.Apps.Core.HandleRules.EnrichedEvents;
using Squidex.Infrastructure; using Squidex.Infrastructure;
namespace Squidex.Domain.Apps.Rules.Action.Webhook namespace Squidex.Extensions.Actions.Webhook
{ {
public sealed class WebhookActionHandler : RuleActionHandler<WebhookAction, WebhookJob> public sealed class WebhookActionHandler : RuleActionHandler<WebhookAction, WebhookJob>
{ {

4
src/Squidex.Domain.Apps.Rules/Squidex.Domain.Apps.Rules.csproj → extensions/Squidex.Extensions/Squidex.Extensions.csproj

@ -7,9 +7,7 @@
<DebugSymbols>True</DebugSymbols> <DebugSymbols>True</DebugSymbols>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Squidex.Domain.Apps.Core.Model\Squidex.Domain.Apps.Core.Model.csproj" /> <ProjectReference Include="..\..\src\Squidex.Domain.Apps.Core.Operations\Squidex.Domain.Apps.Core.Operations.csproj" />
<ProjectReference Include="..\Squidex.Domain.Apps.Core.Operations\Squidex.Domain.Apps.Core.Operations.csproj" />
<ProjectReference Include="..\Squidex.Infrastructure\Squidex.Infrastructure.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Algolia.Search" Version="5.1.0" /> <PackageReference Include="Algolia.Search" Version="5.1.0" />

2
src/Squidex/AppServices.cs

@ -14,7 +14,7 @@ using Squidex.Config;
using Squidex.Config.Authentication; using Squidex.Config.Authentication;
using Squidex.Config.Domain; using Squidex.Config.Domain;
using Squidex.Config.Web; using Squidex.Config.Web;
using Squidex.Domain.Apps.Rules.Action.Twitter; using Squidex.Extensions.Actions.Twitter;
using Squidex.Infrastructure.Commands; using Squidex.Infrastructure.Commands;
namespace Squidex namespace Squidex

2
src/Squidex/Areas/Api/Controllers/Rules/Models/RuleActionProcessor.cs

@ -11,7 +11,7 @@ using NJsonSchema;
using NSwag.SwaggerGeneration.Processors; using NSwag.SwaggerGeneration.Processors;
using NSwag.SwaggerGeneration.Processors.Contexts; using NSwag.SwaggerGeneration.Processors.Contexts;
using Squidex.Domain.Apps.Core.Rules; using Squidex.Domain.Apps.Core.Rules;
using Squidex.Domain.Apps.Rules.Actions; using Squidex.Extensions.Actions;
namespace Squidex.Areas.Api.Controllers.Rules.Models namespace Squidex.Areas.Api.Controllers.Rules.Models
{ {

2
src/Squidex/Areas/Api/Controllers/Rules/Models/RuleActionSerializer.cs

@ -7,7 +7,7 @@
using System.Linq; using System.Linq;
using Squidex.Domain.Apps.Core.Rules; using Squidex.Domain.Apps.Core.Rules;
using Squidex.Domain.Apps.Rules.Actions; using Squidex.Extensions.Actions;
namespace Squidex.Areas.Api.Controllers.Rules.Models namespace Squidex.Areas.Api.Controllers.Rules.Models
{ {

2
src/Squidex/Areas/Api/Controllers/Rules/RulesController.cs

@ -16,7 +16,7 @@ using Squidex.Areas.Api.Controllers.Rules.Models;
using Squidex.Domain.Apps.Entities; using Squidex.Domain.Apps.Entities;
using Squidex.Domain.Apps.Entities.Rules.Commands; using Squidex.Domain.Apps.Entities.Rules.Commands;
using Squidex.Domain.Apps.Entities.Rules.Repositories; using Squidex.Domain.Apps.Entities.Rules.Repositories;
using Squidex.Domain.Apps.Rules.Actions; using Squidex.Extensions.Actions;
using Squidex.Infrastructure.Commands; using Squidex.Infrastructure.Commands;
using Squidex.Infrastructure.Reflection; using Squidex.Infrastructure.Reflection;
using Squidex.Pipeline; using Squidex.Pipeline;

2
src/Squidex/Areas/Api/Controllers/Rules/TwitterController.cs

@ -8,7 +8,7 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Squidex.Domain.Apps.Rules.Action.Twitter; using Squidex.Extensions.Actions.Twitter;
using static CoreTweet.OAuth; using static CoreTweet.OAuth;
namespace Squidex.Areas.Api.Controllers.Rules namespace Squidex.Areas.Api.Controllers.Rules

2
src/Squidex/Areas/Api/Controllers/UI/UIController.cs

@ -13,7 +13,7 @@ using Orleans;
using Squidex.Areas.Api.Controllers.UI.Models; using Squidex.Areas.Api.Controllers.UI.Models;
using Squidex.Config; using Squidex.Config;
using Squidex.Domain.Apps.Entities.Apps; using Squidex.Domain.Apps.Entities.Apps;
using Squidex.Domain.Apps.Rules.Action.Twitter; using Squidex.Extensions.Actions.Twitter;
using Squidex.Infrastructure.Commands; using Squidex.Infrastructure.Commands;
using Squidex.Pipeline; using Squidex.Pipeline;

2
src/Squidex/Config/Domain/RuleServices.cs

@ -9,7 +9,7 @@ using Microsoft.Extensions.DependencyInjection;
using Squidex.Domain.Apps.Core.HandleRules; using Squidex.Domain.Apps.Core.HandleRules;
using Squidex.Domain.Apps.Core.HandleRules.Triggers; using Squidex.Domain.Apps.Core.HandleRules.Triggers;
using Squidex.Domain.Apps.Entities.Rules; using Squidex.Domain.Apps.Entities.Rules;
using Squidex.Domain.Apps.Rules.Actions; using Squidex.Extensions.Actions;
using Squidex.Infrastructure.EventSourcing; using Squidex.Infrastructure.EventSourcing;
namespace Squidex.Config.Domain namespace Squidex.Config.Domain

2
src/Squidex/Config/Domain/SerializationServices.cs

@ -17,7 +17,7 @@ using Squidex.Domain.Apps.Core.Rules.Json;
using Squidex.Domain.Apps.Core.Schemas; using Squidex.Domain.Apps.Core.Schemas;
using Squidex.Domain.Apps.Core.Schemas.Json; using Squidex.Domain.Apps.Core.Schemas.Json;
using Squidex.Domain.Apps.Events; using Squidex.Domain.Apps.Events;
using Squidex.Domain.Apps.Rules.Actions; using Squidex.Extensions.Actions;
using Squidex.Infrastructure; using Squidex.Infrastructure;
using Squidex.Infrastructure.EventSourcing; using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Json; using Squidex.Infrastructure.Json;

2
src/Squidex/Squidex.csproj

@ -34,13 +34,13 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\extensions\Squidex.Extensions\Squidex.Extensions.csproj" />
<ProjectReference Include="..\..\tools\Migrate_01\Migrate_01.csproj" /> <ProjectReference Include="..\..\tools\Migrate_01\Migrate_01.csproj" />
<ProjectReference Include="..\Squidex.Domain.Apps.Core.Model\Squidex.Domain.Apps.Core.Model.csproj" /> <ProjectReference Include="..\Squidex.Domain.Apps.Core.Model\Squidex.Domain.Apps.Core.Model.csproj" />
<ProjectReference Include="..\Squidex.Domain.Apps.Core.Operations\Squidex.Domain.Apps.Core.Operations.csproj" /> <ProjectReference Include="..\Squidex.Domain.Apps.Core.Operations\Squidex.Domain.Apps.Core.Operations.csproj" />
<ProjectReference Include="..\Squidex.Domain.Apps.Entities\Squidex.Domain.Apps.Entities.csproj" /> <ProjectReference Include="..\Squidex.Domain.Apps.Entities\Squidex.Domain.Apps.Entities.csproj" />
<ProjectReference Include="..\Squidex.Domain.Apps.Entities.MongoDb\Squidex.Domain.Apps.Entities.MongoDb.csproj" /> <ProjectReference Include="..\Squidex.Domain.Apps.Entities.MongoDb\Squidex.Domain.Apps.Entities.MongoDb.csproj" />
<ProjectReference Include="..\Squidex.Domain.Apps.Events\Squidex.Domain.Apps.Events.csproj" /> <ProjectReference Include="..\Squidex.Domain.Apps.Events\Squidex.Domain.Apps.Events.csproj" />
<ProjectReference Include="..\Squidex.Domain.Apps.Rules\Squidex.Domain.Apps.Rules.csproj" />
<ProjectReference Include="..\Squidex.Domain.Users\Squidex.Domain.Users.csproj" /> <ProjectReference Include="..\Squidex.Domain.Users\Squidex.Domain.Users.csproj" />
<ProjectReference Include="..\Squidex.Domain.Users.MongoDb\Squidex.Domain.Users.MongoDb.csproj" /> <ProjectReference Include="..\Squidex.Domain.Users.MongoDb\Squidex.Domain.Users.MongoDb.csproj" />
<ProjectReference Include="..\Squidex.Infrastructure.Azure\Squidex.Infrastructure.Azure.csproj" /> <ProjectReference Include="..\Squidex.Infrastructure.Azure\Squidex.Infrastructure.Azure.csproj" />

70
tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/Actions/AlgoliaActionTests.cs

@ -1,70 +0,0 @@
// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschränkt)
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System.Collections.Generic;
using FluentAssertions;
using Squidex.Domain.Apps.Rules.Action.Algolia;
using Squidex.Infrastructure;
using Xunit;
namespace Squidex.Domain.Apps.Entities.Rules.Guards.Actions
{
public class AlgoliaActionTests
{
[Fact]
public void Should_add_error_if_app_id_not_defined()
{
var action = new AlgoliaAction { AppId = null, ApiKey = "KEY", IndexName = "IDX" };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Application Id field is required.", "AppId")
});
}
[Fact]
public void Should_add_error_if_api_key_not_defined()
{
var action = new AlgoliaAction { AppId = "APP", ApiKey = null, IndexName = "IDX" };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Api Key field is required.", "ApiKey")
});
}
[Fact]
public void Should_add_error_if_index_name_not_defined()
{
var action = new AlgoliaAction { AppId = "APP", ApiKey = "KEY", IndexName = null };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Index Name field is required.", "IndexName")
});
}
[Fact]
public void Should_not_add_error_everything_defined()
{
var action = new AlgoliaAction { AppId = "APP", ApiKey = "KEY", IndexName = "IDX" };
var errors = action.Validate();
Assert.Empty(errors);
}
}
}

70
tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/Actions/AzureQueueActionTests.cs

@ -1,70 +0,0 @@
// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschränkt)
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System.Collections.Generic;
using FluentAssertions;
using Squidex.Domain.Apps.Rules.Action.AzureQueue;
using Squidex.Infrastructure;
using Xunit;
namespace Squidex.Domain.Apps.Entities.Rules.Guards.Actions
{
public class AzureQueueActionTests
{
[Fact]
public void Should_add_error_if_connection_string_is_null()
{
var action = new AzureQueueAction { ConnectionString = null, Queue = "squidex" };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Connection String field is required.", "ConnectionString")
});
}
[Fact]
public void Should_add_error_if_queue_is_null()
{
var action = new AzureQueueAction { ConnectionString = "connection", Queue = null };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Queue field is required.", "Queue")
});
}
[Fact]
public void Should_add_error_if_queue_is_invalid()
{
var action = new AzureQueueAction { ConnectionString = "connection", Queue = "Squidex" };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("Queue must be valid azure queue name.", "Queue")
});
}
[Fact]
public void Should_not_add_error_if_values_are_valid()
{
var action = new AzureQueueAction { ConnectionString = "connection", Queue = "squidex" };
var errors = action.Validate();
Assert.Empty(errors);
}
}
}

85
tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/Actions/ElasticSearchActionTests.cs

@ -1,85 +0,0 @@
// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschränkt)
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System;
using System.Collections.Generic;
using FluentAssertions;
using Squidex.Domain.Apps.Rules.Action.ElasticSearch;
using Squidex.Infrastructure;
using Xunit;
namespace Squidex.Domain.Apps.Entities.Rules.Guards.Actions
{
public class ElasticSearchActionTests
{
[Fact]
public void Should_add_error_if_host_is_null()
{
var action = new ElasticSearchAction { Host = null, IndexName = "squidex", IndexType = "squidex" };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Host field is required.", "Host")
});
}
[Fact]
public void Should_add_error_if_host_is_relative()
{
var action = new ElasticSearchAction { Host = new Uri("/rel", UriKind.Relative), IndexName = "squidex", IndexType = "squidex" };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Host field must be an absolute URL.", "Host")
});
}
[Fact]
public void Should_add_error_if_index_name_is_null()
{
var action = new ElasticSearchAction { Host = new Uri("http://host", UriKind.Absolute), IndexName = null, IndexType = "squidex" };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Index Name field is required.", "IndexName")
});
}
[Fact]
public void Should_add_error_if_index_type_is_null()
{
var action = new ElasticSearchAction { Host = new Uri("http://host", UriKind.Absolute), IndexName = "squidex", IndexType = null };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Index Type field is required.", "IndexType")
});
}
[Fact]
public void Should_not_add_error_if_values_are_valid()
{
var action = new ElasticSearchAction { Host = new Uri("http://host", UriKind.Absolute), IndexName = "squidex", IndexType = "squidex" };
var errors = action.Validate();
Assert.Empty(errors);
}
}
}

56
tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/Actions/FastlyActionTests.cs

@ -1,56 +0,0 @@
// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschränkt)
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System.Collections.Generic;
using FluentAssertions;
using Squidex.Domain.Apps.Rules.Action.Fastly;
using Squidex.Infrastructure;
using Xunit;
namespace Squidex.Domain.Apps.Entities.Rules.Guards.Actions
{
public class FastlyActionTests
{
[Fact]
public void Should_add_error_if_service_id_not_defined()
{
var action = new FastlyAction { ServiceId = null, ApiKey = "KEY" };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Service Id field is required.", "ServiceId")
});
}
[Fact]
public void Should_add_error_if_api_key_not_defined()
{
var action = new FastlyAction { ServiceId = "APP", ApiKey = null };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Api Key field is required.", "ApiKey")
});
}
[Fact]
public void Should_not_add_error_everything_defined()
{
var action = new FastlyAction { ServiceId = "APP", ApiKey = "KEY" };
var errors = action.Validate();
Assert.Empty(errors);
}
}
}

70
tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/Actions/MediumActionTests.cs

@ -1,70 +0,0 @@
// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschränkt)
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System.Collections.Generic;
using FluentAssertions;
using Squidex.Domain.Apps.Rules.Action.Medium;
using Squidex.Infrastructure;
using Xunit;
namespace Squidex.Domain.Apps.Entities.Rules.Guards.Actions
{
public class MediumActionTests
{
[Fact]
public void Should_add_error_if_access_token_is_null()
{
var action = new MediumAction { AccessToken = null, Title = "title", Content = "content" };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Access Token field is required.", "AccessToken")
});
}
[Fact]
public void Should_add_error_if_title_null()
{
var action = new MediumAction { AccessToken = "token", Title = null, Content = "content" };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Title field is required.", "Title")
});
}
[Fact]
public void Should_add_error_if_content_is_null()
{
var action = new MediumAction { AccessToken = "token", Title = "title", Content = null };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Content field is required.", "Content")
});
}
[Fact]
public void Should_not_add_error_if_values_are_valid()
{
var action = new MediumAction { AccessToken = "token", Title = "title", Content = "content" };
var errors = action.Validate();
Assert.Empty(errors);
}
}
}

71
tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/Actions/SlackActionTests.cs

@ -1,71 +0,0 @@
// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschränkt)
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System;
using System.Collections.Generic;
using FluentAssertions;
using Squidex.Domain.Apps.Rules.Action.Slack;
using Squidex.Infrastructure;
using Xunit;
namespace Squidex.Domain.Apps.Entities.Rules.Guards.Actions
{
public class SlackActionTests
{
[Fact]
public void Should_add_error_if_webhook_url_is_null()
{
var action = new SlackAction { WebhookUrl = null, Text = "text" };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Webhook Url field is required.", "WebhookUrl")
});
}
[Fact]
public void Should_add_error_if_webhook_url_is_relative()
{
var action = new SlackAction { WebhookUrl = new Uri("/invalid", UriKind.Relative), Text = "text" };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Webhook Url field must be an absolute URL.", "WebhookUrl")
});
}
[Fact]
public void Should_add_error_if_text_is_null()
{
var action = new SlackAction { WebhookUrl = new Uri("https://squidex.io", UriKind.Absolute), Text = null };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Text field is required.", "Text")
});
}
[Fact]
public void Should_not_add_error_if_webhook_url_is_absolute()
{
var action = new SlackAction { WebhookUrl = new Uri("https://squidex.io", UriKind.Absolute), Text = "text" };
var errors = action.Validate();
Assert.Empty(errors);
}
}
}

70
tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/Actions/TweetActionTests.cs

@ -1,70 +0,0 @@
// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschränkt)
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System.Collections.Generic;
using FluentAssertions;
using Squidex.Domain.Apps.Rules.Action.Twitter;
using Squidex.Infrastructure;
using Xunit;
namespace Squidex.Domain.Apps.Entities.Rules.Guards.Actions
{
public class TweetActionTests
{
[Fact]
public void Should_add_error_if_access_token_is_null()
{
var action = new TweetAction { AccessToken = null, AccessSecret = "secret", Text = "text" };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Access Token field is required.", "AccessToken")
});
}
[Fact]
public void Should_add_error_if_access_secret_is_null()
{
var action = new TweetAction { AccessToken = "token", AccessSecret = null, Text = "text" };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Access Secret field is required.", "AccessSecret")
});
}
[Fact]
public void Should_add_error_if_text_is_null()
{
var action = new TweetAction { AccessToken = "token", AccessSecret = "secret", Text = null };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Text field is required.", "Text")
});
}
[Fact]
public void Should_not_add_error_if_access_token_and_secret_defined()
{
var action = new TweetAction { AccessToken = "token", AccessSecret = "secret", Text = "text" };
var errors = action.Validate();
Assert.Empty(errors);
}
}
}

57
tests/Squidex.Domain.Apps.Entities.Tests/Rules/Guards/Actions/WebhookActionTests.cs

@ -1,57 +0,0 @@
// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// Copyright (c) Squidex UG (haftungsbeschränkt)
// All rights reserved. Licensed under the MIT license.
// ==========================================================================
using System;
using System.Collections.Generic;
using FluentAssertions;
using Squidex.Domain.Apps.Rules.Action.Webhook;
using Squidex.Infrastructure;
using Xunit;
namespace Squidex.Domain.Apps.Entities.Rules.Guards.Actions
{
public class WebhookActionTests
{
[Fact]
public void Should_add_error_if_url_is_null()
{
var action = new WebhookAction { Url = null };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Url field is required.", "Url")
});
}
[Fact]
public void Should_add_error_if_url_is_relative()
{
var action = new WebhookAction { Url = new Uri("/invalid", UriKind.Relative) };
var errors = action.Validate();
errors.Should().BeEquivalentTo(
new List<ValidationError>
{
new ValidationError("The Url field must be an absolute URL.", "Url")
});
}
[Fact]
public void Should_not_add_error_if_url_is_absolute()
{
var action = new WebhookAction { Url = new Uri("https://squidex.io", UriKind.Absolute) };
var errors = action.Validate();
Assert.Empty(errors);
}
}
}

1
tests/Squidex.Domain.Apps.Entities.Tests/Squidex.Domain.Apps.Entities.Tests.csproj

@ -14,7 +14,6 @@
<ProjectReference Include="..\..\src\Squidex.Domain.Apps.Core.Operations\Squidex.Domain.Apps.Core.Operations.csproj" /> <ProjectReference Include="..\..\src\Squidex.Domain.Apps.Core.Operations\Squidex.Domain.Apps.Core.Operations.csproj" />
<ProjectReference Include="..\..\src\Squidex.Domain.Apps.Entities.MongoDb\Squidex.Domain.Apps.Entities.MongoDb.csproj" /> <ProjectReference Include="..\..\src\Squidex.Domain.Apps.Entities.MongoDb\Squidex.Domain.Apps.Entities.MongoDb.csproj" />
<ProjectReference Include="..\..\src\Squidex.Domain.Apps.Events\Squidex.Domain.Apps.Events.csproj" /> <ProjectReference Include="..\..\src\Squidex.Domain.Apps.Events\Squidex.Domain.Apps.Events.csproj" />
<ProjectReference Include="..\..\src\Squidex.Domain.Apps.Rules\Squidex.Domain.Apps.Rules.csproj" />
<ProjectReference Include="..\..\src\Squidex.Infrastructure.MongoDb\Squidex.Infrastructure.MongoDb.csproj" /> <ProjectReference Include="..\..\src\Squidex.Infrastructure.MongoDb\Squidex.Infrastructure.MongoDb.csproj" />
<ProjectReference Include="..\..\src\Squidex.Infrastructure\Squidex.Infrastructure.csproj" /> <ProjectReference Include="..\..\src\Squidex.Infrastructure\Squidex.Infrastructure.csproj" />
<ProjectReference Include="..\..\src\Squidex.Domain.Apps.Entities\Squidex.Domain.Apps.Entities.csproj" /> <ProjectReference Include="..\..\src\Squidex.Domain.Apps.Entities\Squidex.Domain.Apps.Entities.csproj" />

Loading…
Cancel
Save