-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Florian Krönert
committed
Jan 19, 2023
1 parent
fcd36a4
commit 3efa97c
Showing
2 changed files
with
30 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -886,5 +886,34 @@ public void It_Should_Not_Throw_On_Custom_Action_If_Throw_Flag_Not_Set() | |
|
||
Assert.That(() => context.ExecutePluginWith<XTLProcessor>(pluginContext), Throws.Nothing); | ||
} | ||
|
||
[Test] | ||
public void It_Should_Not_Break_HTML_Encoded_Stuff() | ||
{ | ||
var context = new XrmFakedContext(); | ||
var dynamicsFromText = "<b>From:</b> Microsoft Power Platform <[email protected]>; <br><b>"; | ||
|
||
var email = new Entity | ||
{ | ||
Id = Guid.NewGuid(), | ||
LogicalName = "email", | ||
Attributes = | ||
{ | ||
{ "subject", "Demo" }, | ||
{ "description", dynamicsFromText } | ||
} | ||
}; | ||
|
||
var pluginContext = context.GetDefaultPluginContext(); | ||
pluginContext.InputParameters = new ParameterCollection | ||
{ | ||
{ "Target", email } | ||
}; | ||
|
||
var config = @"{ ""targetField"": ""description"", ""templateField"": ""description"" }"; | ||
context.ExecutePluginWithConfigurations<XTLProcessor>(pluginContext, config, string.Empty); | ||
|
||
Assert.That(email.GetAttributeValue<string>("description"), Is.EqualTo(dynamicsFromText)); | ||
} | ||
} | ||
} |