-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from DynamicsValue/bugfix/several-updates-fixes
Updated build scripts, added new helper method to create new instances.
- Loading branch information
Showing
9 changed files
with
81 additions
and
21 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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,7 @@ | ||
param ( | ||
[string]$folderPath = "./src/FakeXrmEasy.Core/bin" | ||
) | ||
|
||
if (Test-Path -Path $folderPath) { | ||
Get-ChildItem -Path $folderPath -Include * -File -Recurse | foreach { $_.Delete()} | ||
} |
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
26 changes: 26 additions & 0 deletions
26
tests/FakeXrmEasy.Core.Tests/FakeContextTests/NewEntityRecordTests.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,26 @@ | ||
using System; | ||
using Crm; | ||
using FakeXrmEasy.Tests; | ||
using Xunit; | ||
|
||
namespace FakeXrmEasy.Core.Tests.FakeContextTests | ||
{ | ||
|
||
public class NewEntityRecordTests: FakeXrmEasyTestsBase | ||
{ | ||
[Fact] | ||
public void Should_use_late_bound_if_no_early_bound_entity_has_been_used() | ||
{ | ||
var contact = ((XrmFakedContext)_context).NewEntityRecord("contact"); | ||
Assert.IsNotType<Contact>(contact); | ||
} | ||
|
||
[Fact] | ||
public void Should_use_early_bound_if_the_context_is_using_early_bound() | ||
{ | ||
_context.Initialize(new Contact() { Id = Guid.NewGuid()}); | ||
var contact = ((XrmFakedContext)_context).NewEntityRecord("contact"); | ||
Assert.IsType<Contact>(contact); | ||
} | ||
} | ||
} |