|
|
@ -1,8 +1,10 @@ |
|
|
using System; |
|
|
using System; |
|
|
|
|
|
using System.Linq; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
using EventHub.Events.Registrations; |
|
|
using EventHub.Events.Registrations; |
|
|
using Shouldly; |
|
|
using Shouldly; |
|
|
using Volo.Abp; |
|
|
using Volo.Abp; |
|
|
|
|
|
using Volo.Abp.Domain.Repositories; |
|
|
using Volo.Abp.Timing; |
|
|
using Volo.Abp.Timing; |
|
|
using Xunit; |
|
|
using Xunit; |
|
|
|
|
|
|
|
|
@ -13,12 +15,14 @@ namespace EventHub.Events |
|
|
private readonly IEventAppService _eventAppService; |
|
|
private readonly IEventAppService _eventAppService; |
|
|
private readonly IEventRegistrationAppService _eventRegistrationAppService; |
|
|
private readonly IEventRegistrationAppService _eventRegistrationAppService; |
|
|
private readonly EventHubTestData _testData; |
|
|
private readonly EventHubTestData _testData; |
|
|
|
|
|
private readonly IRepository<Event, Guid> _eventRepository; |
|
|
|
|
|
|
|
|
public EventAppServiceTests() |
|
|
public EventAppServiceTests() |
|
|
{ |
|
|
{ |
|
|
_eventAppService = GetRequiredService<IEventAppService>(); |
|
|
_eventAppService = GetRequiredService<IEventAppService>(); |
|
|
_eventRegistrationAppService = GetRequiredService<IEventRegistrationAppService>(); |
|
|
_eventRegistrationAppService = GetRequiredService<IEventRegistrationAppService>(); |
|
|
_testData = GetRequiredService<EventHubTestData>(); |
|
|
_testData = GetRequiredService<EventHubTestData>(); |
|
|
|
|
|
_eventRepository = GetRequiredService<IRepository<Event, Guid>>(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[Fact] |
|
|
[Fact] |
|
|
@ -157,5 +161,30 @@ namespace EventHub.Events |
|
|
result.ShouldNotBeNull(); |
|
|
result.ShouldNotBeNull(); |
|
|
result.Count.ShouldBeGreaterThan(1); |
|
|
result.Count.ShouldBeGreaterThan(1); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Fact] |
|
|
|
|
|
public async Task Should_Update_The_Event() |
|
|
|
|
|
{ |
|
|
|
|
|
await _eventAppService.UpdateAsync( |
|
|
|
|
|
_testData.AbpMicroservicesFutureEventId, |
|
|
|
|
|
new UpdateEventDto |
|
|
|
|
|
{ |
|
|
|
|
|
Title = "Updated_Microservices_Event_Title", |
|
|
|
|
|
Description = "Updated_Microservices_Event_Description-Updated_Microservices_Event_Description-Updated_Blazor_Microservices_Description", |
|
|
|
|
|
IsOnline = true, |
|
|
|
|
|
Capacity = 100, |
|
|
|
|
|
City = null, |
|
|
|
|
|
CountryId = null, |
|
|
|
|
|
Language = "en", |
|
|
|
|
|
OnlineLink = null |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
var updatedEvent = await _eventRepository.GetAsync(_testData.AbpMicroservicesFutureEventId); |
|
|
|
|
|
|
|
|
|
|
|
updatedEvent.ShouldNotBeNull(); |
|
|
|
|
|
updatedEvent.Title.ShouldBe("Updated_Microservices_Event_Title"); |
|
|
|
|
|
updatedEvent.Description.ShouldBe("Updated_Microservices_Event_Description-Updated_Microservices_Event_Description-Updated_Blazor_Microservices_Description"); |
|
|
|
|
|
updatedEvent.IsOnline.ShouldBeTrue(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|