Skip to content

Commit

Permalink
Merge branch 'master' into fix-boolean-multipart-form-casing
Browse files Browse the repository at this point in the history
  • Loading branch information
damieng authored Jun 23, 2020
2 parents 1d51a77 + 46e9c11 commit 994f741
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions tests/Auth0.ManagementApi.IntegrationTests/StatsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,35 @@
using FluentAssertions;
using Xunit;
using Auth0.Tests.Shared;
using System.Linq;

namespace Auth0.ManagementApi.IntegrationTests
{
public class StatsTests : TestBase
{
[Fact]
public async Task Test_stats_sequence()
public async Task Daily_Stats_Returns_Values()
{
string token = await GenerateManagementApiToken();

using (var apiClient = new ManagementApiClient(token, GetVariable("AUTH0_MANAGEMENT_API_URL")))
{
// Get stats for the past 10 days
var dailyStats = await apiClient.Stats.GetDailyStatsAsync(DateTime.Now.AddDays(-10), DateTime.Now);
var dailyStats = await apiClient.Stats.GetDailyStatsAsync(DateTime.Now.AddDays(-100), DateTime.Now);
dailyStats.Should().NotBeNull();
dailyStats.Count.Should().BeGreaterOrEqualTo(1);
dailyStats.Max(d => d.Logins).Should().BeGreaterThan(0);
}
}

// Get the active users
[Fact(Skip = "Inactivity causes these to fail")]
public async Task Active_Users_Returns_Values()
{
string token = await GenerateManagementApiToken();

using (var apiClient = new ManagementApiClient(token, GetVariable("AUTH0_MANAGEMENT_API_URL")))
{
var activeUsers = await apiClient.Stats.GetActiveUsersAsync();
activeUsers.Should().BeGreaterOrEqualTo(1); // These integration tests themselves trigger non-zero values
activeUsers.Should().BeGreaterThan(0);
}
}
}
Expand Down

0 comments on commit 994f741

Please sign in to comment.