Skip to content

Commit

Permalink
Merge pull request #42 from DynamicsValue/feature/update-2011-dependency
Browse files Browse the repository at this point in the history
Remove old dependency DynamicsValue/fake-xrm-easy#105
  • Loading branch information
jordimontana82 authored Jun 10, 2023
2 parents 59723b5 + 05752c1 commit 916407e
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 51 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,7 @@ reportgenerator

#Coverage results
coverage/
nupkgs/
nupkgs/

#Ignore JetBrains rider
.idea/
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [2.3.2]

### Changed

- Update legacy CRM SDK 2011 dependency to use official MS package - https://github.com/DynamicsValue/fake-xrm-easy/issues/105

## [2.3.0]

### Changed
Expand Down
14 changes: 10 additions & 4 deletions src/FakeXrmEasy.Core/Extensions/TypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace FakeXrmEasy.Extensions
public static class TypeExtensions
{
/// <summary>
///
/// Returns true if the type is an OptionSetValue
/// </summary>
/// <param name="t"></param>
/// <returns></returns>
Expand All @@ -24,6 +24,12 @@ public static bool IsOptionSet(this Type t)
}

#if FAKE_XRM_EASY_9

/// <summary>
/// Returns true if the type is an OptionSetValueCollection
/// </summary>
/// <param name="t"></param>
/// <returns></returns>
public static bool IsOptionSetValueCollection(this Type t)
{
var nullableType = Nullable.GetUnderlyingType(t);
Expand All @@ -32,7 +38,7 @@ public static bool IsOptionSetValueCollection(this Type t)
#endif

/// <summary>
///
/// Returns true if the type is a DateTime
/// </summary>
/// <param name="t"></param>
/// <returns></returns>
Expand All @@ -44,7 +50,7 @@ public static bool IsDateTime(this Type t)
}

/// <summary>
///
/// Returns true if the type is a Nullable Enum
/// </summary>
/// <param name="t"></param>
/// <returns></returns>
Expand All @@ -57,7 +63,7 @@ public static bool IsNullableEnum(this Type t)
}

/// <summary>
///
/// Gets the PropertyInfo for an attribute of an earlybound type
/// </summary>
/// <param name="earlyBoundType"></param>
/// <param name="attributeName"></param>
Expand Down
38 changes: 19 additions & 19 deletions src/FakeXrmEasy.Core/FakeXrmEasy.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<TargetFrameworks Condition="'$(Configuration)'=='FAKE_XRM_EASY_2013'">net452</TargetFrameworks>
<TargetFrameworks Condition="'$(Configuration)'=='FAKE_XRM_EASY'">net452</TargetFrameworks>
<PackageId>FakeXrmEasy.Core</PackageId>
<VersionPrefix>2.3.0</VersionPrefix>
<VersionPrefix>2.3.2</VersionPrefix>
<Authors>Jordi Montaña</Authors>
<Company>Dynamics Value</Company>
<Title>FakeXrmEasy Core</Title>
Expand All @@ -34,31 +34,31 @@
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_9</DefineConstants>
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_9;FXE_V2</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY'">
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY</DefineConstants>
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY;FXE_V2</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_2013'">
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_2013</DefineConstants>
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_2013;FXE_V2</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_2015'">
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_2015</DefineConstants>
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_2015;FXE_V2</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_2016'">
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_2016</DefineConstants>
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_2016;FXE_V2</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_365'">
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_365</DefineConstants>
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_365;FXE_V2</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_9'">
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_9</DefineConstants>
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_9;FXE_V2</DefineConstants>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462' And '$(Configuration)'=='FAKE_XRM_EASY_9'">
Expand Down Expand Up @@ -95,10 +95,10 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net452' And '$(Configuration)'=='FAKE_XRM_EASY'">
<PackageReference Include="Microsoft.Xrm.Sdk.2011" Version="[5.0.18]" />
<PackageReference Include="Microsoft.Crm.Sdk.Proxy.2011" Version="[5.0.18]" />
<PackageReference Include="Microsoft.Xrm.Sdk.Workflow.2011" Version="[5.0.18]" />
<PackageReference Include="Microsoft.Xrm.Client.2011" Version="[5.0.18]" />
<PackageReference Include="Microsoft.CrmSdk.CoreAssemblies" Version="[5.0.18]" />
<PackageReference Include="Microsoft.CrmSdk.Extensions" Version="[5.0.18]" />
<PackageReference Include="Microsoft.CrmSdk.Workflow" Version="[5.0.18]" />
<PackageReference Include="Microsoft.CrmSdk.Deployment" Version="[5.0.18]" />
<Reference Include="System.ServiceModel" />
</ItemGroup>

Expand All @@ -107,25 +107,25 @@
</ItemGroup>

<ItemGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY'">
<PackageReference Include="FakeXrmEasy.Abstractions.v2011" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v2011" Version="[2.3.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_2013'">
<PackageReference Include="FakeXrmEasy.Abstractions.v2013" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v2013" Version="[2.3.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_2015'">
<PackageReference Include="FakeXrmEasy.Abstractions.v2015" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v2015" Version="[2.3.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_2016'">
<PackageReference Include="FakeXrmEasy.Abstractions.v2016" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v2016" Version="[2.3.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_365'">
<PackageReference Include="FakeXrmEasy.Abstractions.v365" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v365" Version="[2.3.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_9'">
<PackageReference Include="FakeXrmEasy.Abstractions.v9" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v9" Version="[2.3.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='Debug'">
<PackageReference Include="FakeXrmEasy.Abstractions.v9" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v9" Version="[2.3.2-*,3.0)" />
</ItemGroup>

<Target Name="PreparePackageReleaseNotesFromFile" BeforeTargets="GenerateNuspec">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,28 @@

namespace FakeXrmEasy.Middleware.Crud.FakeMessageExecutors
{
/// <summary>
/// Fake Message executor for Upsert requests
/// </summary>
public class UpsertRequestExecutor : IFakeMessageExecutor
{
/// <summary>
/// Returns true if this message executor can execute the specified request
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public bool CanExecute(OrganizationRequest request)
{
return request is UpsertRequest;
}


/// <summary>
/// Executes the current request with the given context
/// </summary>
/// <param name="request"></param>
/// <param name="ctx"></param>
/// <returns></returns>
public OrganizationResponse Execute(OrganizationRequest request, IXrmFakedContext ctx)
{
var fakedContext = ctx as XrmFakedContext;
Expand Down Expand Up @@ -44,6 +59,10 @@ public OrganizationResponse Execute(OrganizationRequest request, IXrmFakedContex
return result;
}

/// <summary>
/// Gets request type that will execute this request
/// </summary>
/// <returns></returns>
public Type GetResponsibleRequestType()
{
return typeof(UpsertRequest);
Expand Down
3 changes: 3 additions & 0 deletions src/FakeXrmEasy.Core/XrmRealContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public class XrmRealContext : IXrmRealContext
/// </summary>
public ICallerProperties CallerProperties { get; set; }

/// <summary>
/// Plugin Context Properties
/// </summary>
public IXrmFakedPluginContextProperties PluginContextProperties { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Crm;
#if !FXE_V2 //Rpcrt4 related, not working on Linux
using Crm;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Messages;
using System;
Expand Down Expand Up @@ -95,4 +96,5 @@ public void When_calling_context_add_addrelated_and_save_changes_entities_are_ad
}

}
}
}
#endif
50 changes: 25 additions & 25 deletions tests/FakeXrmEasy.Core.Tests/FakeXrmEasy.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<IsPackable>true</IsPackable>

<PackageId>FakeXrmEasy.CoreTests</PackageId>
<VersionPrefix>2.3.0</VersionPrefix>
<VersionPrefix>2.3.2</VersionPrefix>
<Authors>Jordi Montaña</Authors>
<Company>Dynamics Value S.L.</Company>
<Title>Internal Unit test suite for FakeXrmEasy.Core package</Title>
Expand All @@ -37,31 +37,31 @@
</ItemGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_9</DefineConstants>
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_9;FXE_V2</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY'">
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY</DefineConstants>
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY;FXE_V2</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_2013'">
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_2013</DefineConstants>
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_2013;FXE_V2</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_2015'">
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_2015</DefineConstants>
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_2015;FXE_V2</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_2016'">
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_2016</DefineConstants>
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_2016;FXE_V2</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_365'">
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_365</DefineConstants>
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_365;FXE_V2</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_9'">
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_9</DefineConstants>
<DefineConstants>DEBUG;TRACE;FAKE_XRM_EASY_9;FXE_V2</DefineConstants>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462' And '$(Configuration)'=='FAKE_XRM_EASY_9'">
Expand Down Expand Up @@ -98,10 +98,10 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net452' And '$(Configuration)'=='FAKE_XRM_EASY'">
<PackageReference Include="Microsoft.Xrm.Sdk.2011" Version="[5.0.18]" />
<PackageReference Include="Microsoft.Crm.Sdk.Proxy.2011" Version="[5.0.18]" />
<PackageReference Include="Microsoft.Xrm.Sdk.Workflow.2011" Version="[5.0.18]" />
<PackageReference Include="Microsoft.Xrm.Client.2011" Version="[5.0.18]" />
<PackageReference Include="Microsoft.CrmSdk.CoreAssemblies" Version="[5.0.18]" />
<PackageReference Include="Microsoft.CrmSdk.Extensions" Version="[5.0.18]" />
<PackageReference Include="Microsoft.CrmSdk.Workflow" Version="[5.0.18]" />
<PackageReference Include="Microsoft.CrmSdk.Deployment" Version="[5.0.18]" />
<Reference Include="System.ServiceModel" />
</ItemGroup>

Expand All @@ -115,48 +115,48 @@
</ItemGroup>

<ItemGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY'">
<PackageReference Include="FakeXrmEasy.Abstractions.v2011" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v2011" Version="[2.3.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_2013'">
<PackageReference Include="FakeXrmEasy.Abstractions.v2013" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v2013" Version="[2.3.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_2015'">
<PackageReference Include="FakeXrmEasy.Abstractions.v2015" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v2015" Version="[2.3.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_2016'">
<PackageReference Include="FakeXrmEasy.Abstractions.v2016" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v2016" Version="[2.3.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_365'">
<PackageReference Include="FakeXrmEasy.Abstractions.v365" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v365" Version="[2.3.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='FAKE_XRM_EASY_9'">
<PackageReference Include="FakeXrmEasy.Abstractions.v9" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v9" Version="[2.3.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='Debug'">
<PackageReference Include="FakeXrmEasy.Abstractions.v9" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Abstractions.v9" Version="[2.3.2-*,3.0)" />
</ItemGroup>

<ItemGroup Condition="'$(PackTests)' == ''">
<ProjectReference Include="..\..\src\FakeXrmEasy.Core\FakeXrmEasy.Core.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY'">
<PackageReference Include="FakeXrmEasy.Core.v2011" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v2011" Version="[2.3.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_2013'">
<PackageReference Include="FakeXrmEasy.Core.v2013" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v2013" Version="[2.3.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_2015'">
<PackageReference Include="FakeXrmEasy.Core.v2015" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v2015" Version="[2.3.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_2016'">
<PackageReference Include="FakeXrmEasy.Core.v2016" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v2016" Version="[2.3.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_365'">
<PackageReference Include="FakeXrmEasy.Core.v365" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v365" Version="[2.3.2-*,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(PackTests)' == 'true' And '$(Configuration)'=='FAKE_XRM_EASY_9'">
<PackageReference Include="FakeXrmEasy.Core.v9" Version="[2.3.0-*,3.0)" />
<PackageReference Include="FakeXrmEasy.Core.v9" Version="[2.3.2-*,3.0)" />
</ItemGroup>

</Project>

0 comments on commit 916407e

Please sign in to comment.