mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1005 B
30 lines
1005 B
// ==========================================================================
|
|
// AssertHelper.cs
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex Group
|
|
// All rights reserved.
|
|
// ==========================================================================
|
|
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using FluentAssertions;
|
|
using Squidex.Infrastructure.CQRS.Events;
|
|
|
|
namespace Squidex.Domain.Apps.Write.TestHelpers
|
|
{
|
|
public static class AssertHelper
|
|
{
|
|
public static void ShouldHaveSameEvents(this IEnumerable<Envelope<IEvent>> events, params IEvent[] others)
|
|
{
|
|
var source = events.Select(x => x.Payload).ToArray();
|
|
|
|
source.Should().HaveSameCount(others);
|
|
|
|
for (var i = 0; i < source.Length; i++)
|
|
{
|
|
((object)source[i]).ShouldBeEquivalentTo(others[i], o => o.IncludingAllDeclaredProperties());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|