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.
44 lines
1.4 KiB
44 lines
1.4 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using FakeItEasy;
|
|
using Orleans.Core;
|
|
using Squidex.Infrastructure;
|
|
using Squidex.Infrastructure.Commands;
|
|
using Squidex.Infrastructure.Orleans;
|
|
using Xunit;
|
|
|
|
#pragma warning disable CA1806 // Do not ignore method results
|
|
|
|
namespace Squidex.Domain.Apps.Entities.Contents.DomainObject
|
|
{
|
|
public class ContentDomainObjectGrainTests
|
|
{
|
|
private readonly IActivationLimit limit = A.Fake<IActivationLimit>();
|
|
|
|
[Fact]
|
|
public void Should_set_limit()
|
|
{
|
|
var id = DomainId.NewGuid();
|
|
|
|
var identity = A.Fake<IGrainIdentity>();
|
|
|
|
A.CallTo(() => identity.PrimaryKeyString)
|
|
.Returns(id.ToString());
|
|
|
|
var factory = A.Fake<IDomainObjectFactory>();
|
|
|
|
A.CallTo(() => factory.Create<ContentDomainObject>(id))
|
|
.Returns(A.Dummy<ContentDomainObject>());
|
|
|
|
new ContentDomainObjectGrain(identity, factory, limit);
|
|
|
|
A.CallTo(() => limit.SetLimit(5000, TimeSpan.FromMinutes(5)))
|
|
.MustHaveHappened();
|
|
}
|
|
}
|
|
}
|
|
|