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.
50 lines
1.6 KiB
50 lines
1.6 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using TestSuite.Fixtures;
|
|
|
|
#pragma warning disable SA1300 // Element should begin with upper-case letter
|
|
|
|
namespace TestSuite.ApiTests;
|
|
|
|
public class TeamStatisticsTests(CreatedTeamFixture fixture) : IClassFixture<CreatedTeamFixture>
|
|
{
|
|
public CreatedTeamFixture _ { get; } = fixture;
|
|
|
|
[Fact]
|
|
public async Task Should_get_api_calls()
|
|
{
|
|
// STEP 1: Get statistics.
|
|
var dateFrom = DateTimeOffset.UtcNow.AddDays(-30);
|
|
var dateTo = DateTimeOffset.UtcNow;
|
|
|
|
var result = await _.Client.Statistics.GetUsagesForTeamAsync(_.TeamId, dateFrom, dateTo);
|
|
|
|
Assert.NotNull(result);
|
|
}
|
|
|
|
[Fact]
|
|
public async Task Should_get_storage_size()
|
|
{
|
|
// STEP 1: Get statistics.
|
|
var dateFrom = DateTimeOffset.UtcNow.AddDays(-30);
|
|
var dateTo = DateTimeOffset.UtcNow;
|
|
|
|
var result = await _.Client.Statistics.GetStorageSizesForTeamAsync(_.TeamId, dateFrom, dateTo);
|
|
|
|
Assert.NotNull(result);
|
|
}
|
|
|
|
[Fact]
|
|
public async Task Should_get_current_storage_size_for()
|
|
{
|
|
// STEP 1: Get statistics.
|
|
var result = await _.Client.Statistics.GetTeamCurrentStorageSizeForTeamAsync(_.TeamId);
|
|
|
|
Assert.NotNull(result);
|
|
}
|
|
}
|
|
|