Skip to content

Commit

Permalink
Fixes #79 null body when calling history store get
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenRedd committed Jul 27, 2017
1 parent 4dfe686 commit 2b6ecab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,14 @@ internal static DeliveryItem ToDeliveryItem(this EntityHistoryDeliveryItem item)
SourceApplicationName = item.SourceApplicationName,
Body =
string.IsNullOrEmpty(item.TemplateName)
? (IMessageBody) new TemplateBody
{
TemplateName = item.TemplateName
}
: new ContentBody
? new ContentBody
{
HtmlContent = item.HtmlContent,
PlainTextContent = item.TextContent
}
: (IMessageBody)new TemplateBody
{
TemplateName = item.TemplateName
},
Substitutions = JsonConvert.DeserializeObject<IDictionary<string, string>>(item.SubstitutionsJson),
CreatedDate = item.CreatedDate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public async Task Ef_Sql_History_AddWithCustomSourceApplicationName(string html,
var id = await store.AddAsync(item);
var savedItem = await store.GetAsync(id);
savedItem.SourceApplicationName.Should().Be("testUpdatedValue");
var body = savedItem.Body.Should().BeOfType<ContentBody>();
body.Which.HtmlContent.Should().Be(html);
body.Which.PlainTextContent.Should().Be(text);
}
}

Expand Down

0 comments on commit 2b6ecab

Please sign in to comment.