|
|
@ -29,6 +29,7 @@ namespace Squidex.Domain.Apps.Entities.Contents |
|
|
.AddField("field2", |
|
|
.AddField("field2", |
|
|
new ContentFieldData() |
|
|
new ContentFieldData() |
|
|
.AddValue("iv", 2)); |
|
|
.AddValue("iv", 2)); |
|
|
|
|
|
private readonly NamedContentData patched; |
|
|
private readonly Guid contentId = Guid.NewGuid(); |
|
|
private readonly Guid contentId = Guid.NewGuid(); |
|
|
private readonly ContentDomainObject sut = new ContentDomainObject(); |
|
|
private readonly ContentDomainObject sut = new ContentDomainObject(); |
|
|
|
|
|
|
|
|
@ -37,6 +38,11 @@ namespace Squidex.Domain.Apps.Entities.Contents |
|
|
get { return contentId; } |
|
|
get { return contentId; } |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ContentDomainObjectTests() |
|
|
|
|
|
{ |
|
|
|
|
|
patched = otherData.MergeInto(data); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
[Fact] |
|
|
[Fact] |
|
|
public void Create_should_throw_exception_if_created() |
|
|
public void Create_should_throw_exception_if_created() |
|
|
{ |
|
|
{ |
|
|
@ -141,12 +147,13 @@ namespace Squidex.Domain.Apps.Entities.Contents |
|
|
public void Patch_should_create_events() |
|
|
public void Patch_should_create_events() |
|
|
{ |
|
|
{ |
|
|
CreateContent(); |
|
|
CreateContent(); |
|
|
|
|
|
UpdateContent(); |
|
|
|
|
|
|
|
|
sut.Patch(CreateContentCommand(new PatchContent { Data = otherData })); |
|
|
sut.Patch(CreateContentCommand(new PatchContent { Data = otherData })); |
|
|
|
|
|
|
|
|
sut.GetUncomittedEvents() |
|
|
sut.GetUncomittedEvents() |
|
|
.ShouldHaveSameEvents( |
|
|
.ShouldHaveSameEvents( |
|
|
CreateContentEvent(new ContentUpdated { Data = otherData }) |
|
|
CreateContentEvent(new ContentUpdated { Data = patched }) |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|