-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
…nContext* interfaces DynamicsValue/fake-xrm-easy#122
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System; | ||
using Microsoft.Xrm.Sdk; | ||
|
||
namespace FakeXrmEasy.Plugins.PluginExecutionContext | ||
{ | ||
/// <summary> | ||
/// Implements IPluginExecutionContext2 interface, an extension of IPluginExecutionContext adding support for azure AAD properties | ||
/// </summary> | ||
public class XrmFakedPluginExecutionContext2: XrmFakedPluginExecutionContext, IPluginExecutionContext2 | ||
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext2.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2015)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext2.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2015)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext2.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2013)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext2.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2013)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext2.cs GitHub Actions / build-windows (FAKE_XRM_EASY_365)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext2.cs GitHub Actions / build-windows (FAKE_XRM_EASY_365)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext2.cs GitHub Actions / build-windows (FAKE_XRM_EASY_365)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext2.cs GitHub Actions / build-windows (FAKE_XRM_EASY_365)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext2.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2016)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext2.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2016)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext2.cs GitHub Actions / build-windows (FAKE_XRM_EASY)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext2.cs GitHub Actions / build-windows (FAKE_XRM_EASY)
|
||
{ | ||
/// <summary> | ||
/// Gets azure active directory object Id of user. | ||
/// </summary> | ||
public Guid UserAzureActiveDirectoryObjectId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets azure active directory object Id of user that initiates web service. | ||
/// </summary> | ||
public Guid InitiatingUserAzureActiveDirectoryObjectId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets application Id of user that initiates the plugin (for NON-app user .. it is Guid.Empty) | ||
/// </summary> | ||
public Guid InitiatingUserApplicationId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets contactId that got passed for the calls that come from portals client to web service (for NON-portal/Anonymous call, it is guid.Empty) | ||
/// </summary> | ||
public Guid PortalsContactId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets a value indicating whether 'True' if the call is originated from Portals client | ||
/// </summary> | ||
public bool IsPortalsClientCall { get; set;} | ||
|
||
/// <summary> | ||
/// Default constructor | ||
/// </summary> | ||
public XrmFakedPluginExecutionContext2() | ||
{ | ||
UserAzureActiveDirectoryObjectId = Guid.NewGuid(); | ||
InitiatingUserAzureActiveDirectoryObjectId = Guid.NewGuid(); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using Microsoft.Xrm.Sdk; | ||
|
||
namespace FakeXrmEasy.Plugins.PluginExecutionContext | ||
{ | ||
/// <summary> | ||
/// Implements IPluginExecutionContext2 interface, an extension of IPluginExecutionContext adding support for azure AAD properties | ||
/// </summary> | ||
public class XrmFakedPluginExecutionContext3: XrmFakedPluginExecutionContext2, IPluginExecutionContext3 | ||
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext3.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2015)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext3.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2015)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext3.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2013)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext3.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2013)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext3.cs GitHub Actions / build-windows (FAKE_XRM_EASY_365)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext3.cs GitHub Actions / build-windows (FAKE_XRM_EASY_365)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext3.cs GitHub Actions / build-windows (FAKE_XRM_EASY_365)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext3.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2016)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext3.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2016)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext3.cs GitHub Actions / build-windows (FAKE_XRM_EASY)
Check failure on line 9 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext3.cs GitHub Actions / build-windows (FAKE_XRM_EASY)
|
||
{ | ||
/// <summary> | ||
/// Gets id of the authenticated user | ||
/// </summary> | ||
public Guid AuthenticatedUserId { get; } | ||
|
||
/// <summary> | ||
/// Default constructor | ||
/// </summary> | ||
public XrmFakedPluginExecutionContext3() | ||
{ | ||
AuthenticatedUserId = Guid.NewGuid(); | ||
} | ||
|
||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Microsoft.Xrm.Sdk; | ||
|
||
namespace FakeXrmEasy.Plugins.PluginExecutionContext | ||
{ | ||
public class XrmFakedPluginExecutionContext4: XrmFakedPluginExecutionContext3, IPluginExecutionContext4 | ||
Check failure on line 5 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext4.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2015)
Check failure on line 5 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext4.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2015)
Check failure on line 5 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext4.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2013)
Check failure on line 5 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext4.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2013)
Check failure on line 5 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext4.cs GitHub Actions / build-windows (FAKE_XRM_EASY_365)
Check failure on line 5 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext4.cs GitHub Actions / build-windows (FAKE_XRM_EASY_365)
Check failure on line 5 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext4.cs GitHub Actions / build-windows (FAKE_XRM_EASY_365)
Check failure on line 5 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext4.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2016)
Check failure on line 5 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext4.cs GitHub Actions / build-windows (FAKE_XRM_EASY_2016)
Check failure on line 5 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext4.cs GitHub Actions / build-windows (FAKE_XRM_EASY)
Check failure on line 5 in src/FakeXrmEasy.Plugins/PluginExecutionContext/XrmFakedPluginExecutionContext4.cs GitHub Actions / build-windows (FAKE_XRM_EASY)
|
||
{ | ||
/// <summary> | ||
/// Contains a collection of PreEntityImages | ||
/// </summary> | ||
public EntityImageCollection[] PreEntityImagesCollection { get; set; } | ||
|
||
/// <summary> | ||
/// Contains a collection of PostEntityImages | ||
/// </summary> | ||
public EntityImageCollection[] PostEntityImagesCollection { get; set; } | ||
|
||
/// <summary> | ||
/// Default constructor | ||
/// </summary> | ||
public XrmFakedPluginExecutionContext4() | ||
{ | ||
PreEntityImagesCollection = new EntityImageCollection[] {}; | ||
PostEntityImagesCollection = new EntityImageCollection[] {}; | ||
} | ||
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using FakeXrmEasy.Plugins.PluginExecutionContext; | ||
using System; | ||
using Xunit; | ||
|
||
namespace FakeXrmEasy.Plugins.Tests.XrmFakedPluginExecutionContextTests | ||
{ | ||
public class XrmFakedPluginExecutionContext2Tests | ||
{ | ||
[Fact] | ||
public void Should_set_default_plugin_context_properties() | ||
{ | ||
var plugCtx = new XrmFakedPluginExecutionContext2(); | ||
|
||
Assert.NotEqual(Guid.Empty, plugCtx.UserAzureActiveDirectoryObjectId); | ||
Assert.NotEqual(Guid.Empty, plugCtx.InitiatingUserAzureActiveDirectoryObjectId); | ||
|
||
Assert.Equal(Guid.Empty, plugCtx.InitiatingUserApplicationId); | ||
|
||
Assert.False(plugCtx.IsPortalsClientCall); | ||
Assert.Equal(Guid.Empty, plugCtx.PortalsContactId); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using FakeXrmEasy.Plugins.PluginExecutionContext; | ||
using Xunit; | ||
|
||
namespace FakeXrmEasy.Plugins.Tests.XrmFakedPluginExecutionContextTests | ||
{ | ||
public class XrmFakedPluginExecutionContext3Tests | ||
{ | ||
[Fact] | ||
public void Should_set_default_plugin_context_properties() | ||
{ | ||
var plugCtx = new XrmFakedPluginExecutionContext3(); | ||
|
||
Assert.NotEqual(Guid.Empty, plugCtx.AuthenticatedUserId); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using FakeXrmEasy.Plugins.PluginExecutionContext; | ||
using System; | ||
using Xunit; | ||
|
||
namespace FakeXrmEasy.Plugins.Tests.XrmFakedPluginExecutionContextTests | ||
{ | ||
public class XrmFakedPluginExecutionContext4Tests | ||
{ | ||
[Fact] | ||
public void Should_set_default_plugin_context_properties() | ||
{ | ||
var plugCtx = new XrmFakedPluginExecutionContext4(); | ||
|
||
Assert.NotNull(plugCtx.PreEntityImagesCollection); | ||
Assert.NotNull(plugCtx.PostEntityImagesCollection); | ||
} | ||
} | ||
} |