public async Task TestGetInvitesByLocationId() { LocationsByOrgIdGetOKResponse response = await Client.LocationsByOrgIdGetAsync(OrgId); Assert.NotNull(response.Locations); Assert.IsNotEmpty(response.Locations); var location = TestContext.CurrentContext.Random.Next(response.Locations.Count - 1); InvitationsByLocationGetOKResponse invitationResponse = await Client.InvitationsByLocationGetAsync(response.Locations[location].LocationId); Assert.NotNull(invitationResponse.Invites); Assert.IsNotEmpty(invitationResponse.Invites); }
public async Task TestGetInvitationsWithPageSize(long pageSize) { LocationsByOrgIdGetOKResponse response = await Client.LocationsByOrgIdGetAsync(OrgId); Assert.NotNull(response.Locations); Assert.IsNotEmpty(response.Locations); var location = TestContext.CurrentContext.Random.Next(response.Locations.Count - 1); InvitationsByLocationGetOKResponse invitationResponse = await Client.InvitationsByLocationGetAsync(response.Locations[location].LocationId, 1, pageSize); Assert.That(invitationResponse.Invites, Is.Unique); Assert.LessOrEqual(invitationResponse.Invites.Count, pageSize); }
public async Task TestGetInvitationsWithPage() { LocationsByOrgIdGetOKResponse response = await Client.LocationsByOrgIdGetAsync(OrgId); Assert.NotNull(response.Locations); Assert.IsNotEmpty(response.Locations); var location = TestContext.CurrentContext.Random.Next(response.Locations.Count - 1); InvitationsByLocationGetOKResponse invitationResponse = await Client.InvitationsByLocationGetAsync(response.Locations[location].LocationId, 1, 10); InvitationsByLocationGetOKResponse invitationResponse2 = await Client.InvitationsByLocationGetAsync(response.Locations[location].LocationId, 2, 5); foreach (var invite in invitationResponse.Invites.Skip(5).Take(5)) { Assert.Contains(invite, invitationResponse2.Invites.ToArray()); } }
public async Task TestGetInvitationsWithDateRange() { LocationsByOrgIdGetOKResponse response = await Client.LocationsByOrgIdGetAsync(OrgId); Assert.NotNull(response.Locations); Assert.IsNotEmpty(response.Locations); var location = TestContext.CurrentContext.Random.Next(response.Locations.Count - 1); DateTime fromDate = DateTime.Now.AddDays(-30).Date; DateTime toDate = DateTime.Now.AddDays(-15).Date; InvitationsByLocationGetOKResponse invitationResponse = await Client.InvitationsByLocationGetAsync(response.Locations[location].LocationId, fromDate : fromDate, toDate : toDate); foreach (var invite in invitationResponse.Invites) { Assert.GreaterOrEqual(invite.CreatedAt, fromDate); Assert.LessOrEqual(invite.CreatedAt, toDate); } }