Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New messages #32

Merged
merged 17 commits into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## [2.5.0]

### Added

- **Minor Breaking Change**: Generic Message executors have been moved to *FakeXrmEasy.FakeMessageExecutors.GenericExecutors* namespace for consistency with their own interface name
- Add ExportPdfDocumentExecutor - https://github.com/DynamicsValue/fake-xrm-easy/issues/125
- Add RetrieveCurrentOrganizationRequest executor - https://github.com/DynamicsValue/fake-xrm-easy/issues/136

### Changed

- Introduces validation error when trying to add a user to a default team - https://github.com/DynamicsValue/fake-xrm-easy/issues/108
- Fixes responsible type in CloseIncidentRequestExecutor - https://github.com/DynamicsValue/fake-xrm-easy/issues/116
- Increase code coverage for NavigateToNextEntityOrganizationRequest
- Remove unnecessary checks in NavigateToNextEntityOrganizationRequestExecutor: thanks Temmy

## [2.4.0]

## Added
Expand Down
2 changes: 2 additions & 0 deletions FakeXrmEasy.Messages.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=isdefault/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#if FAKE_XRM_EASY_9 || FAKE_XRM_EASY_365 || FAKE_XRM_EASY_2016 || FAKE_XRM_EASY_2015

using Microsoft.Xrm.Sdk.Organization;

namespace FakeXrmEasy.Messages.ContextProperties
{
/// <summary>
/// Stores information about the current organization details
/// </summary>
public class CurrentOrganizationDetails
{
/// <summary>
/// The organization details
/// </summary>
public OrganizationDetail Details { get; set; }
}
}
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;

namespace FakeXrmEasy.Messages.Exceptions.ExportPdfDocumentRequest
{
/// <summary>
/// Exception raised when the EntityTypeCode parameter is missing
/// </summary>
public class EntityTypeCodeNotSpecifiedException: Exception
{
/// <summary>
/// Default constructor
/// </summary>
public EntityTypeCodeNotSpecifiedException() : base("When executing ExportPdfDocument request, EntityTypeCode parameter is required but was not specified")
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;

namespace FakeXrmEasy.Messages.Exceptions.ExportPdfDocumentRequest
{
/// <summary>
/// Exception raised when the EntityTypeCode parameter is not a valid integer
/// </summary>
public class EntityTypeCodeNotValidException: Exception
{
/// <summary>
/// Default constructor
/// </summary>
public EntityTypeCodeNotValidException() : base("When executing ExportPdfDocument request, EntityTypeCode parameter is required but is not valid")
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;

namespace FakeXrmEasy.Messages.Exceptions.ExportPdfDocumentRequest
{
/// <summary>
/// Exception raised when the SelectedRecords parameter doesn't have a valid format
/// </summary>
public class SelectedRecordsIsNotValidException: Exception
{
/// <summary>
/// Default constructor
/// </summary>
public SelectedRecordsIsNotValidException() : base("When executing ExportPdfDocument request, SelectedRecords parameter is required but not valid. Must be a string representation of an array of Guid's")
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;

namespace FakeXrmEasy.Messages.Exceptions.ExportPdfDocumentRequest
{
/// <summary>
/// Exception raised when the SelectedRecords parameter is valid but not found
/// </summary>
public class SelectedRecordsNotFoundException: Exception
{
/// <summary>
/// Default constructor
/// </summary>
public SelectedRecordsNotFoundException() : base("When executing ExportPdfDocument request, SelectedRecords parameter was specified but at least one record was not found")
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;

namespace FakeXrmEasy.Messages.Exceptions.ExportPdfDocumentRequest
{
/// <summary>
/// Exception raised when the SelectedRecords parameter is missing
/// </summary>
public class SelectedRecordsNotSpecifiedException: Exception
{
/// <summary>
/// Default constructor
/// </summary>
public SelectedRecordsNotSpecifiedException() : base("When executing ExportPdfDocument request, SelectedRecords parameter is required but was not specified")
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;

namespace FakeXrmEasy.Messages.Exceptions.ExportPdfDocumentRequest
{
/// <summary>
/// Exception raised when the SelectedTemplate was specified but not a valid EntityReference
/// </summary>
public class SelectedTemplateMustBeEntityReferenceException: Exception
{
/// <summary>
/// Default constructor
/// </summary>
public SelectedTemplateMustBeEntityReferenceException() : base("When executing ExportPdfDocument request, SelectedTemplate must be an EntityReference to a document template record")
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;

namespace FakeXrmEasy.Messages.Exceptions.ExportPdfDocumentRequest
{
/// <summary>
/// Exception raised when the SelectedTemplate was specified but not found (it doesn't exists)
/// </summary>
public class SelectedTemplateNotFoundException: Exception
{
/// <summary>
/// Default constructor
/// </summary>
public SelectedTemplateNotFoundException() : base("When executing ExportPdfDocument request, a SelectedTemplate was specified in the request but not found")
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;

namespace FakeXrmEasy.Messages.Exceptions.ExportPdfDocumentRequest
{
/// <summary>
/// Exception raised when the SelectedTemplate parameter is missing
/// </summary>
public class SelectedTemplateNotSpecifiedException: Exception
{
/// <summary>
/// Default constructor
/// </summary>
public SelectedTemplateNotSpecifiedException() : base("When executing ExportPdfDocument request, SelectedTemplate parameter is required but was not specified")
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;

namespace FakeXrmEasy.Messages.Exceptions.NavigateToNextEntityOrganizationRequest
{
/// <summary>
/// Exception raised when the entity record of the current stage associated to a given business process does not exist
/// </summary>
public class CurrentEntityNotFoundException: Exception
{
/// <summary>
/// Default constructor
/// </summary>
/// <param name="logicalName"></param>
/// <param name="id"></param>
public CurrentEntityNotFoundException(string logicalName, Guid id):
base($"There is no current entity record with logical name '{logicalName}' and Id '{id}'")
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;

namespace FakeXrmEasy.Messages.Exceptions.NavigateToNextEntityOrganizationRequest
{
/// <summary>
/// Exception raised when the record of the the next stage in a given business process does not exist
/// </summary>
public class NextEntityNotFoundException: Exception
{
/// <summary>
/// Default constructor
/// </summary>
/// <param name="logicalName"></param>
/// <param name="id"></param>
public NextEntityNotFoundException(string logicalName, Guid id):
base($"There is no next entity record with logical name '{logicalName}' and Id '{id}'")
{

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ public OrganizationResponse Execute(OrganizationRequest request, IXrmFakedContex
throw FakeOrganizationServiceFaultFactory.New(ErrorCodes.ObjectDoesNotExist, string.Format("Team with Id {0} wasn't found", req.TeamId.ToString()));
}

if (team.GetAttributeValue<bool?>("isdefault") == true)
{
throw FakeOrganizationServiceFaultFactory.New(ErrorCodes.CannotAddMembersToDefaultTeam, "You cannot join one or more of the teams selected. The membership of default teams cannot be modified.");
}

foreach (var memberId in req.MemberIds)
{
var user = ctx.CreateQuery("systemuser").FirstOrDefault(e => e.Id == memberId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace FakeXrmEasy.FakeMessageExecutors
{
public class CloseIncidentRequestExecutor : IFakeMessageExecutor

Check warning on line 10 in src/FakeXrmEasy.Messages/FakeMessageExecutors/CloseIncidentRequestExecutor.cs

View workflow job for this annotation

GitHub Actions / build-windows (FAKE_XRM_EASY_2016)

Missing XML comment for publicly visible type or member 'CloseIncidentRequestExecutor'

Check warning on line 10 in src/FakeXrmEasy.Messages/FakeMessageExecutors/CloseIncidentRequestExecutor.cs

View workflow job for this annotation

GitHub Actions / build-windows (FAKE_XRM_EASY_9)

Missing XML comment for publicly visible type or member 'CloseIncidentRequestExecutor'

Check warning on line 10 in src/FakeXrmEasy.Messages/FakeMessageExecutors/CloseIncidentRequestExecutor.cs

View workflow job for this annotation

GitHub Actions / build-windows (FAKE_XRM_EASY_2013)

Missing XML comment for publicly visible type or member 'CloseIncidentRequestExecutor'

Check warning on line 10 in src/FakeXrmEasy.Messages/FakeMessageExecutors/CloseIncidentRequestExecutor.cs

View workflow job for this annotation

GitHub Actions / build-windows (FAKE_XRM_EASY)

Missing XML comment for publicly visible type or member 'CloseIncidentRequestExecutor'

Check warning on line 10 in src/FakeXrmEasy.Messages/FakeMessageExecutors/CloseIncidentRequestExecutor.cs

View workflow job for this annotation

GitHub Actions / build-windows (FAKE_XRM_EASY_2015)

Missing XML comment for publicly visible type or member 'CloseIncidentRequestExecutor'

Check warning on line 10 in src/FakeXrmEasy.Messages/FakeMessageExecutors/CloseIncidentRequestExecutor.cs

View workflow job for this annotation

GitHub Actions / build-windows (FAKE_XRM_EASY_365)

Missing XML comment for publicly visible type or member 'CloseIncidentRequestExecutor'
{
private const string AttributeIncidentId = "incidentid";
private const string AttributeSubject = "subject";
Expand Down Expand Up @@ -85,7 +85,7 @@
/// <returns></returns>
public Type GetResponsibleRequestType()
{
return typeof(CloseIncidentResponse);
return typeof(CloseIncidentRequest);
}
}
}
Loading
Loading