mirror of
https://github.com/farcasclaudiu/PracticeCalendar.git
synced 2026-06-22 17:01:23 +03:00
50 lines
1.3 KiB
C#
50 lines
1.3 KiB
C#
using FluentAssertions;
|
|
using PracticeCalendar.Application.PracticeEvents.Queries.GetPracticeEvents;
|
|
using PracticeCalendar.Domain.Entities;
|
|
|
|
using static PracticeCalendar.UnitTests.Integration.Testing;
|
|
|
|
namespace PracticeCalendar.UnitTests.Integration.PracticeEvents
|
|
{
|
|
public class GetPracticeEventsTest : BaseTest
|
|
{
|
|
|
|
[Fact]
|
|
public async Task ShouldReturnZeroResult()
|
|
{
|
|
await RunBeforeAnyTests();
|
|
|
|
var query = new GetPracticeEventsQuery();
|
|
|
|
var result = await SendAsync(query);
|
|
|
|
result.Count.Should().Be(0);
|
|
}
|
|
|
|
[Fact]
|
|
public async Task ShouldReturnAllListsAndItems()
|
|
{
|
|
await RunBeforeAnyTests();
|
|
|
|
await AddAsync(new PracticeEvent("Test Event", "Event description",
|
|
DateTime.Now.AddHours(-1), DateTime.Now.AddHours(1))
|
|
{
|
|
Id = 1,
|
|
Attendees = {
|
|
new Attendee("Claudiu F", "claudiuf@busybee.com")
|
|
{
|
|
Id = 1
|
|
}
|
|
}
|
|
});
|
|
|
|
var query = new GetPracticeEventsQuery();
|
|
|
|
var result = await SendAsync(query);
|
|
|
|
result.Should().HaveCount(1);
|
|
result.First().Attendees.Should().HaveCount(1);
|
|
}
|
|
}
|
|
}
|