forked from jordimontana82/fake-xrm-easy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added DeleteRecordChangeHistoryRequest Fake executor for Shared project.
Added DeleteRecordChangeHistoryRequestTest Fake executor for Test Shared project.
- Loading branch information
Victor Sanchez
authored and
Victor Sanchez
committed
Jan 8, 2021
1 parent
f294b9a
commit f00f716
Showing
4 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
FakeXrmEasy.Shared/FakeMessageExecutors/DeleteRecordChangeHistoryRequestExecutor.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,30 @@ | ||
using Microsoft.Xrm.Sdk; | ||
using Microsoft.Crm.Sdk.Messages; | ||
using System; | ||
using System.ServiceModel; | ||
namespace FakeXrmEasy.FakeMessageExecutors | ||
{ | ||
public class DeleteRecordChangeHistoryRequestExecutor : IFakeMessageExecutor | ||
{ | ||
|
||
public bool CanExecute(OrganizationRequest request) | ||
{ | ||
return request is DeleteRecordChangeHistoryRequest; | ||
} | ||
|
||
public OrganizationResponse Execute(OrganizationRequest request, XrmFakedContext ctx) | ||
{ | ||
var req = request as DeleteRecordChangeHistoryRequest; | ||
|
||
var res = new DeleteRecordChangeHistoryResponse(); | ||
|
||
return res; | ||
} | ||
|
||
public Type GetResponsibleRequestType() | ||
{ | ||
return typeof(DeleteRecordChangeHistoryRequest); | ||
} | ||
} | ||
|
||
} |
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
29 changes: 29 additions & 0 deletions
29
...ntextTests/DeleteRecordChangeHistoryRequestTests/DeleteRecordChangeHistoryRequestTests.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,29 @@ | ||
using FakeXrmEasy.FakeMessageExecutors; | ||
using Microsoft.Crm.Sdk.Messages; | ||
using Microsoft.Xrm.Sdk; | ||
using Microsoft.Xrm.Sdk.Messages; | ||
using Xunit; | ||
|
||
namespace FakeXrmEasy.Tests.FakeContextTests.DeleteRecordChangeHistoryRequestTests | ||
{ | ||
public class DeleteRecordChangeHistoryRequestTests | ||
{ | ||
[Fact] | ||
public void When_can_execute_is_called_with_an_invalid_request_result_is_false() | ||
{ | ||
var executor = new DeleteRecordChangeHistoryRequestExecutor(); | ||
var anotherRequest = new RetrieveMultipleRequest(); | ||
Assert.False(executor.CanExecute(anotherRequest)); | ||
} | ||
|
||
[Fact] | ||
public void When_execute_is_called_with_a_null_target_exception_is_thrown() | ||
{ | ||
var ctx = new XrmFakedContext(); | ||
var service = ctx.GetOrganizationService(); | ||
var orgReq = new OrganizationRequest(); | ||
var res = new DeleteRecordChangeHistoryRequestExecutor().Execute(orgReq, ctx); | ||
Assert.IsType(typeof(DeleteRecordChangeHistoryResponse), res); | ||
} | ||
} | ||
} |
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