Browse Source

Add missing tests and refactor

pull/79/head
berkansasmaz 5 years ago
parent
commit
148801d5eb
No known key found for this signature in database GPG Key ID: 884D815C3F32BE00
  1. 2
      src/EventHub.Domain.Shared/EventHubErrorCodes.cs
  2. 3
      src/EventHub.Domain.Shared/Localization/EventHub/en.json
  3. 31
      src/EventHub.Domain/Events/Event.cs
  4. 17
      src/EventHub.Domain/Events/Track.cs
  5. 104
      test/EventHub.Application.Tests/Events/EventAppServiceTests.cs
  6. 369
      test/EventHub.Domain.Tests/Events/EventTests.cs
  7. 44
      test/EventHub.TestBase/EventHubTestDataSeedContributor.cs

2
src/EventHub.Domain.Shared/EventHubErrorCodes.cs

@ -20,5 +20,7 @@
public const string TrackNotFound = "EventHub:TrackNotFound";
public const string SessionNotFound = "EventHub:SessionNotFound";
public const string DraftEventNotFound = "EventHub:DraftEventNotFound";
public const string SessionTitleAlreadyExist = "EventHub:SessionTitleAlreadyExist";
}
}

3
src/EventHub.Domain.Shared/Localization/EventHub/en.json

@ -158,6 +158,7 @@
"EventHub:SessionNotFound": "The session not found!",
"EventHub:SessionTimeShouldBeInTheEventTime": "Session time should be in the event time!",
"EventHub:SessionTimeConflictsWithAnExistingSession": "Session time conflicts with an existing session!",
"EventHub:DraftEventNotFound": "The draft event not found!"
"EventHub:DraftEventNotFound": "The draft event not found!",
"EventHub:SessionTitleAlreadyExist": "The session {Title} already exists"
}
}

31
src/EventHub.Domain/Events/Event.cs

@ -71,6 +71,8 @@ namespace EventHub.Events
SetTitle(title);
SetDescription(description);
SetTimeInternal(startTime, endTime);
Publish(false);
Tracks = new Collection<Track>();
}
@ -182,16 +184,7 @@ namespace EventHub.Events
string language,
ICollection<Guid> speakerUserIds)
{
// TODO: This control is already done in Track and even Session. Do you really need this?
if (startTime > endTime)
{
throw new BusinessException(EventHubErrorCodes.EndTimeCantBeEarlierThanStartTime);
}
if (startTime < this.StartTime || this.EndTime < endTime)
{
throw new BusinessException(EventHubErrorCodes.SessionTimeShouldBeInTheEventTime);
}
CheckIfValidSessionTime(startTime, endTime);
var track = GetTrack(trackId);
track.AddSession(sessionId, title, description,startTime, endTime, language, speakerUserIds);
@ -202,12 +195,14 @@ namespace EventHub.Events
Guid trackId,
Guid sessionId,
string title,
string description,
DateTime startTime,
DateTime endTime,
string description,
string language,
ICollection<Guid> speakerUserIds)
{
CheckIfValidSessionTime(startTime, endTime);
var track = GetTrack(trackId);
track.UpdateSession(sessionId, title, description, startTime, endTime, language, speakerUserIds);
return this;
@ -238,5 +233,19 @@ namespace EventHub.Events
return Tracks.FirstOrDefault(t => t.Id == trackId) ??
throw new EntityNotFoundException(typeof(Track), trackId);
}
private void CheckIfValidSessionTime(DateTime startTime, DateTime endTime)
{
// TODO: This control is already done in Track and even Session. Do you really need this?
if (startTime > endTime)
{
throw new BusinessException(EventHubErrorCodes.SessionEndTimeCantBeEarlierThanStartTime);
}
if (startTime < this.StartTime || this.EndTime < endTime)
{
throw new BusinessException(EventHubErrorCodes.SessionTimeShouldBeInTheEventTime);
}
}
}
}

17
src/EventHub.Domain/Events/Track.cs

@ -46,6 +46,12 @@ namespace EventHub.Events
string language,
ICollection<Guid> speakerUserIds)
{
if (Sessions.Any(s => s.Title == title))
{
throw new BusinessException(EventHubErrorCodes.SessionTitleAlreadyExist)
.WithData("Title", title);
}
if (startTime > endTime)
{
throw new BusinessException(EventHubErrorCodes.EndTimeCantBeEarlierThanStartTime);
@ -77,12 +83,12 @@ namespace EventHub.Events
if (session.StartTime != startTime)
{
CheckIfValidSessionTime(endTime);
CheckIfValidSessionTime(endTime, sessionId);
}
if (session.EndTime != endTime)
{
CheckIfValidSessionTime(endTime);
CheckIfValidSessionTime(endTime, sessionId);
}
session.SetTitle(title);
@ -115,10 +121,15 @@ namespace EventHub.Events
return this;
}
private void CheckIfValidSessionTime(DateTime date)
private void CheckIfValidSessionTime(DateTime date, Guid? sessionId = null)
{
foreach (var session in Sessions)
{
if (sessionId.HasValue && sessionId!.Value == session.Id)
{
continue;
}
if (date.IsBetween(session.StartTime, session.EndTime))
{
throw new BusinessException(EventHubErrorCodes.SessionTimeConflictsWithAnExistingSession);

104
test/EventHub.Application.Tests/Events/EventAppServiceTests.cs

@ -1,9 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EventHub.Events.Registrations;
using Microsoft.Extensions.DependencyInjection;
using NSubstitute;
using Shouldly;
using Volo.Abp;
using Volo.Abp.Authorization;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Timing;
@ -227,6 +230,107 @@ namespace EventHub.Events
updatedEvent.Description.ShouldBe("Updated_Microservices_Event_Description-Updated_Microservices_Event_Description-Updated_Blazor_Microservices_Description");
updatedEvent.IsOnline.ShouldBeTrue();
}
[Fact]
public async Task Should_Add_The_Track()
{
Login(_testData.UserAdminId);
var eventDetailDto = await _eventAppService.GetByUrlCodeAsync(_testData.AbpMicroservicesFutureEventUrlCode);
await _eventAppService.AddTrackAsync(eventDetailDto.Id, new AddTractDto
{
Name = "Track-1"
});
var updatedEvent = await _eventAppService.GetByUrlCodeAsync(_testData.AbpMicroservicesFutureEventUrlCode);
updatedEvent.ShouldNotBeNull();
updatedEvent.Tracks.ShouldContain(x => x.Name == "Track-1");
}
[Fact]
public async Task Should_Add_The_Session()
{
Login(_testData.UserAdminId);
var eventDetailDto = await _eventAppService.GetByUrlCodeAsync(_testData.AbpMicroservicesFutureEventUrlCode);
await _eventAppService.AddTrackAsync(eventDetailDto.Id, new AddTractDto
{
Name = "Track-1"
});
var updatedEvent = await _eventAppService.GetByUrlCodeAsync(_testData.AbpMicroservicesFutureEventUrlCode);
var speakerUserNames = new List<string>();
speakerUserNames.Add(_testData.UserAdminUserName);
speakerUserNames.Add(_testData.UserJohnUserName);
await _eventAppService.AddSessionAsync(eventDetailDto.Id, updatedEvent.Tracks.First().Id, new AddSessionDto
{
Title = "Session-1 Title",
Description = "Session-1 Description".PadLeft(50, 't'),
StartTime = updatedEvent.StartTime.AddSeconds(1),
EndTime = updatedEvent.StartTime.AddSeconds(50),
Language = "tr",
SpeakerUserNames = speakerUserNames
});
updatedEvent = await _eventAppService.GetByUrlCodeAsync(_testData.AbpMicroservicesFutureEventUrlCode);
updatedEvent.ShouldNotBeNull();
updatedEvent.Tracks.ShouldContain(x => x.Name == "Track-1");
var track = updatedEvent.Tracks.Single(x => x.Name == "Track-1");
track.Sessions.ShouldContain(x => x.Title == "Session-1 Title");
track.Sessions.ShouldContain(x => x.StartTime == updatedEvent.StartTime.AddSeconds(1));
track.Sessions.ShouldContain(x => x.EndTime == updatedEvent.StartTime.AddSeconds(50));
track.Sessions.ShouldContain(x => x.Language == "tr");
var session = track.Sessions.Single(x => x.Title == "Session-1 Title");
session.Speakers.ShouldContain(x => x.UserId == _testData.UserAdminId);
session.Speakers.ShouldContain(x => x.UserId == _testData.UserJohnId);
}
[Fact]
public async Task Should_Publish_Event()
{
Login(_testData.UserAdminId);
var eventDto = await _eventAppService.CreateAsync(
new CreateEventDto
{
OrganizationId = _testData.OrganizationVolosoftId,
Title = "Introduction to the ABP Framework",
Description = "In this event, we will introduce the ABP Framework and explore the fundamental features.",
StartTime = DateTime.Now.AddDays(1),
EndTime = DateTime.Now.AddDays(1).AddHours(3),
IsOnline = true,
Capacity = 2,
Language = "en"
}
);
Login(_testData.UserJohnId);
var exception = await Assert.ThrowsAsync<AbpAuthorizationException>(async () =>
{
await _eventAppService.GetByUrlCodeAsync(eventDto.UrlCode);
});
exception.Code.ShouldBe(EventHubErrorCodes.NotAuthorizedToUpdateEvent);
Login(_testData.UserAdminId);
await _eventAppService.PublishAsync(eventDto.Id);
Login(_testData.UserJohnId);
var @event = await _eventAppService.GetByUrlCodeAsync(eventDto.UrlCode);
@event.ShouldNotBeNull();
@event.Title.ShouldBe("Introduction to the ABP Framework");
}
private void Login(Guid userId)
{

369
test/EventHub.Domain.Tests/Events/EventTests.cs

@ -1,12 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Shouldly;
using Volo.Abp;
using Xunit;
namespace EventHub.Events
{
public class EventTests
public class EventTests : EventHubDomainTestBase
{
private readonly EventHubTestData _testData;
public EventTests()
{
_testData = GetRequiredService<EventHubTestData>();
}
[Fact]
public void Should_Not_Allow_End_Time_To_Be_Earlier_Than_Start_Time()
{
@ -25,5 +35,362 @@ namespace EventHub.Events
exception.Code.ShouldBe(EventHubErrorCodes.EndTimeCantBeEarlierThanStartTime);
}
[Fact]
public void Should_Add_Track_A_Valid_Track()
{
var @event = new Event(
Guid.NewGuid(),
Guid.NewGuid(),
"1a8j3v0d",
"Introduction to the ABP Framework",
DateTime.Now,
DateTime.Now.AddDays(2),
"In this event, we will introduce the ABP Framework and explore the fundamental features."
);
@event.AddTract(Guid.NewGuid(), "Track-1");
@event.Tracks.ShouldContain(x => x.Name == "Track-1");
}
[Fact]
public void Should_Not_Add_Track_For_Exist_Same_Track_Name()
{
var @event = new Event(
Guid.NewGuid(),
Guid.NewGuid(),
"1a8j3v0d",
"Introduction to the ABP Framework",
DateTime.Now,
DateTime.Now.AddDays(2),
"In this event, we will introduce the ABP Framework and explore the fundamental features."
);
@event.AddTract(Guid.NewGuid(), "Track-1");
var exception = Assert.Throws<BusinessException>(() => { @event.AddTract(Guid.NewGuid(), "Track-1"); });
exception.Code.ShouldBe(EventHubErrorCodes.TrackNameAlreadyExist);
}
[Fact]
public void Should_Update_Track_A_Valid_Track()
{
var @event = new Event(
Guid.NewGuid(),
Guid.NewGuid(),
"1a8j3v0d",
"Introduction to the ABP Framework",
DateTime.Now,
DateTime.Now.AddDays(2),
"In this event, we will introduce the ABP Framework and explore the fundamental features."
);
@event.AddTract(Guid.NewGuid(), "Track-1");
@event.AddTract(Guid.NewGuid(), "Track-2");
@event.Tracks.ShouldContain(x => x.Name == "Track-2");
}
[Fact]
public void Should_Not_Update_Track_For_Exist_Same_Track_Name()
{
var @event = new Event(
Guid.NewGuid(),
Guid.NewGuid(),
"1a8j3v0d",
"Introduction to the ABP Framework",
DateTime.Now,
DateTime.Now.AddDays(2),
"In this event, we will introduce the ABP Framework and explore the fundamental features."
);
var track1Id = Guid.NewGuid();
@event.AddTract(track1Id, "Track-1");
@event.AddTract(Guid.NewGuid(), "Track-2");
var exception = Assert.Throws<BusinessException>(() => { @event.UpdateTrack(track1Id, "Track-2"); });
exception.Code.ShouldBe(EventHubErrorCodes.TrackNameAlreadyExist);
}
[Fact]
public void Should_Not_Update_Track_For_Not_Exist_Track_Id()
{
var @event = new Event(
Guid.NewGuid(),
Guid.NewGuid(),
"1a8j3v0d",
"Introduction to the ABP Framework",
DateTime.Now,
DateTime.Now.AddDays(2),
"In this event, we will introduce the ABP Framework and explore the fundamental features."
);
var exception = Assert.Throws<BusinessException>(() => { @event.UpdateTrack(Guid.NewGuid(), "Track-1"); });
exception.Code.ShouldBe(EventHubErrorCodes.TrackNotFound);
}
[Fact]
public void Should_Remove_Track_A_Valid_Track()
{
var @event = new Event(
Guid.NewGuid(),
Guid.NewGuid(),
"1a8j3v0d",
"Introduction to the ABP Framework",
DateTime.Now,
DateTime.Now.AddDays(2),
"In this event, we will introduce the ABP Framework and explore the fundamental features."
);
var track1Id = Guid.NewGuid();
@event.AddTract(track1Id, "Track-1");
@event.AddTract(Guid.NewGuid(), "Track-2");
@event.RemoveTrack(track1Id);
@event.Tracks.ShouldNotContain(x => x.Name == "Track-1");
}
[Fact]
public void Should_Not_Remove_Track_For_Not_Exist_Track_Id()
{
var @event = new Event(
Guid.NewGuid(),
Guid.NewGuid(),
"1a8j3v0d",
"Introduction to the ABP Framework",
DateTime.Now,
DateTime.Now.AddDays(2),
"In this event, we will introduce the ABP Framework and explore the fundamental features."
);
var exception = Assert.Throws<BusinessException>(() => { @event.RemoveTrack(Guid.NewGuid()); });
exception.Code.ShouldBe(EventHubErrorCodes.TrackNotFound);
}
[Fact]
public void Should_Add_Session_A_Valid_Session()
{
var @event = new Event(
Guid.NewGuid(),
Guid.NewGuid(),
"1a8j3v0d",
"Introduction to the ABP Framework",
DateTime.Now,
DateTime.Now.AddDays(2),
"In this event, we will introduce the ABP Framework and explore the fundamental features."
);
var track1Id = Guid.NewGuid();
@event.AddTract(track1Id, "Track-1");
var session1Id = Guid.NewGuid();
@event.AddSession(track1Id, session1Id, "Session-1 Title", "Session-1 desc".PadLeft(50, 't'), DateTime.Now, DateTime.Now, "en", new List<Guid>());
@event.Tracks.ShouldContain(x => x.Name == "Track-1");
var track = @event.Tracks.Single(x => x.Name == "Track-1");
track.Sessions.ShouldContain(x => x.Id == session1Id);
}
[Fact]
public void Should_Not_Add_Session_For_Exist_Same_Session_Name()
{
var @event = new Event(
Guid.NewGuid(),
Guid.NewGuid(),
"1a8j3v0d",
"Introduction to the ABP Framework",
DateTime.Now,
DateTime.Now.AddDays(2),
"In this event, we will introduce the ABP Framework and explore the fundamental features."
);
var track1Id = Guid.NewGuid();
@event.AddTract(track1Id, "Track-1");
@event.AddSession(track1Id, Guid.NewGuid(), "Session-1 Title", "Session-1 desc".PadLeft(50, 't'), DateTime.Now, DateTime.Now.AddHours(1), "en", new List<Guid>());
var exception = Assert.Throws<BusinessException>(() =>
{
@event.AddSession(track1Id, Guid.NewGuid(), "Session-1 Title", "Session-1 desc".PadLeft(50, 't'), DateTime.Now.AddHours(2), DateTime.Now.AddHours(3), "en", new List<Guid>());
});
exception.Code.ShouldBe(EventHubErrorCodes.SessionTitleAlreadyExist);
}
[Fact]
public void Should_Not_Add_Session_For_End_Time_To_Be_Earlier_Than_Start_Time()
{
var @event = new Event(
Guid.NewGuid(),
Guid.NewGuid(),
"1a8j3v0d",
"Introduction to the ABP Framework",
DateTime.Now,
DateTime.Now.AddDays(2),
"In this event, we will introduce the ABP Framework and explore the fundamental features."
);
var track1Id = Guid.NewGuid();
@event.AddTract(track1Id, "Track-1");
var exception = Assert.Throws<BusinessException>(() =>
{
@event.AddSession(track1Id, Guid.NewGuid(), "Session-1 Title", "Session-1 desc".PadLeft(50, 't'), DateTime.Now.AddHours(2), DateTime.Now.AddHours(1), "en", new List<Guid>());
});
exception.Code.ShouldBe(EventHubErrorCodes.SessionEndTimeCantBeEarlierThanStartTime);
}
[Fact]
public void Should_Not_Add_Session_For_Session_Time_Is_Not_In_Event_Time()
{
var @event = new Event(
Guid.NewGuid(),
Guid.NewGuid(),
"1a8j3v0d",
"Introduction to the ABP Framework",
DateTime.Now,
DateTime.Now.AddDays(2),
"In this event, we will introduce the ABP Framework and explore the fundamental features."
);
var track1Id = Guid.NewGuid();
@event.AddTract(track1Id, "Track-1");
var exception = Assert.Throws<BusinessException>(() =>
{
@event.AddSession(track1Id, Guid.NewGuid(), "Session-1 Title", "Session-1 desc".PadLeft(50, 't'), DateTime.Now.AddHours(2), DateTime.Now.AddDays(3), "en", new List<Guid>());
});
exception.Code.ShouldBe(EventHubErrorCodes.SessionTimeShouldBeInTheEventTime);
}
[Fact]
public void Should_Not_Add_Session_For_Session_Time_Conflicts_With_An_Existing_Session()
{
var @event = new Event(
Guid.NewGuid(),
Guid.NewGuid(),
"1a8j3v0d",
"Introduction to the ABP Framework",
DateTime.Now,
DateTime.Now.AddDays(2),
"In this event, we will introduce the ABP Framework and explore the fundamental features."
);
var track1Id = Guid.NewGuid();
@event.AddTract(track1Id, "Track-1");
@event.AddSession(track1Id, Guid.NewGuid(), "Session-1 Title", "Session-1 desc".PadLeft(50, 't'), DateTime.Now, DateTime.Now.AddDays(1), "en", new List<Guid>());
var exception = Assert.Throws<BusinessException>(() =>
{
@event.AddSession(track1Id, Guid.NewGuid(), "Session-2 Title", "Session-2 desc".PadLeft(50, 't'), DateTime.Now, DateTime.Now.AddDays(1), "en", new List<Guid>());
});
exception.Code.ShouldBe(EventHubErrorCodes.SessionTimeConflictsWithAnExistingSession);
}
[Fact]
public void Should_Add_Session_With_Speakers()
{
var @event = new Event(
Guid.NewGuid(),
Guid.NewGuid(),
"1a8j3v0d",
"Introduction to the ABP Framework",
DateTime.Now,
DateTime.Now.AddDays(2),
"In this event, we will introduce the ABP Framework and explore the fundamental features."
);
var track1Id = Guid.NewGuid();
@event.AddTract(track1Id, "Track-1");
var speakerUserIds = new List<Guid>();
speakerUserIds.Add(_testData.UserAdminId);
speakerUserIds.Add(_testData.UserJohnId);
var sessionId = Guid.NewGuid();
@event.AddSession(track1Id, sessionId, "Session-1 Title", "Session-1 desc".PadLeft(50, 't'), DateTime.Now, DateTime.Now.AddDays(1), "en", speakerUserIds);
var track = @event.Tracks.Single(x => x.Id == track1Id);
var session = track.Sessions.Single(x => x.Id == sessionId);
session.Speakers.ShouldContain(x => x.UserId == _testData.UserAdminId);
session.Speakers.ShouldContain(x => x.UserId == _testData.UserJohnId);
}
[Fact]
public void Should_Update_Session_With_Valid_Session()
{
var @event = new Event(
Guid.NewGuid(),
Guid.NewGuid(),
"1a8j3v0d",
"Introduction to the ABP Framework",
DateTime.Now,
DateTime.Now.AddDays(2),
"In this event, we will introduce the ABP Framework and explore the fundamental features."
);
var track1Id = Guid.NewGuid();
@event.AddTract(track1Id, "Track-1");
var speakerUserIds = new List<Guid>();
speakerUserIds.Add(_testData.UserAdminId);
speakerUserIds.Add(_testData.UserJohnId);
var sessionId = Guid.NewGuid();
@event.AddSession(track1Id, sessionId, "Session-1 Title", "Session-1 desc".PadLeft(50, 't'), @event.StartTime.AddMinutes(30), @event.EndTime.AddHours(-1), "en", speakerUserIds);
var track = @event.Tracks.Single(x => x.Id == track1Id);
var session = track.Sessions.Single(x => x.Id == sessionId);
session.Title.ShouldContain("Session-1 Title");
speakerUserIds = new List<Guid>();
speakerUserIds.Add(_testData.UserAdminId);
@event.UpdateSession(track1Id, sessionId, "Session-1 Title Updated", "Session-1 desc".PadLeft(50, 't'), @event.StartTime.AddMinutes(30), @event.EndTime.AddMinutes(-70), "en", speakerUserIds);
track = @event.Tracks.Single(x => x.Id == track1Id);
session = track.Sessions.Single(x => x.Id == sessionId);
session.Title.ShouldContain("Session-1 Title Updated");
session.Speakers.ShouldContain(x => x.UserId == _testData.UserAdminId);
session.Speakers.ShouldNotContain(x => x.UserId == _testData.UserJohnId);
}
[Fact]
public void Should_Remove_Session_A_Valid_Session()
{
var @event = new Event(
Guid.NewGuid(),
Guid.NewGuid(),
"1a8j3v0d",
"Introduction to the ABP Framework",
DateTime.Now,
DateTime.Now.AddDays(2),
"In this event, we will introduce the ABP Framework and explore the fundamental features."
);
var track1Id = Guid.NewGuid();
@event.AddTract(track1Id, "Track-1");
var speakerUserIds = new List<Guid>();
speakerUserIds.Add(_testData.UserAdminId);
speakerUserIds.Add(_testData.UserJohnId);
var sessionId = Guid.NewGuid();
@event.AddSession(track1Id, sessionId, "Session-1 Title", "Session-1 desc".PadLeft(50, 't'), DateTime.Now, DateTime.Now.AddDays(1), "en", speakerUserIds);
speakerUserIds = new List<Guid>();
speakerUserIds.Add(_testData.UserAdminId);
@event.RemoveSession(track1Id, sessionId);
var track = @event.Tracks.Single(x => x.Id == track1Id);
track.Sessions.ShouldNotContain(x => x.Id == sessionId);
}
}
}

44
test/EventHub.TestBase/EventHubTestDataSeedContributor.cs

@ -78,31 +78,33 @@ namespace EventHub
private async Task CreateEventsAsync()
{
var pastEvent = new Event(
_eventHubTestData.AbpBlazorPastEventId,
_eventHubTestData.OrganizationVolosoftId,
_eventHubTestData.AbpBlazorPastEventUrlCode,
_eventHubTestData.AbpBlazorPastEventTitle,
_clock.Now.ClearTime().AddDays(-2).AddHours(15),
_clock.Now.ClearTime().AddDays(-2).AddHours(17),
"This is a past event about Blazor and the ABP Framework."
);
pastEvent.Publish();
await _eventRepository.InsertAsync(
new Event(
_eventHubTestData.AbpBlazorPastEventId,
_eventHubTestData.OrganizationVolosoftId,
_eventHubTestData.AbpBlazorPastEventUrlCode,
_eventHubTestData.AbpBlazorPastEventTitle,
_clock.Now.ClearTime().AddDays(-2).AddHours(15),
_clock.Now.ClearTime().AddDays(-2).AddHours(17),
"This is a past event about Blazor and the ABP Framework."
)
pastEvent
);
var futureEvent = new Event(
_eventHubTestData.AbpMicroservicesFutureEventId,
_eventHubTestData.OrganizationVolosoftId,
_eventHubTestData.AbpMicroservicesFutureEventUrlCode,
_eventHubTestData.AbpMicroservicesFutureEventTitle,
_clock.Now.ClearTime().AddDays(1).AddHours(15),
_clock.Now.ClearTime().AddDays(1).AddHours(17),
"This is a future event about the ABP Framework and Microservices that is set for tomorrow."
);
futureEvent.Capacity = 1;
futureEvent.Publish();
await _eventRepository.InsertAsync(
new Event(
_eventHubTestData.AbpMicroservicesFutureEventId,
_eventHubTestData.OrganizationVolosoftId,
_eventHubTestData.AbpMicroservicesFutureEventUrlCode,
_eventHubTestData.AbpMicroservicesFutureEventTitle,
_clock.Now.ClearTime().AddDays(1).AddHours(15),
_clock.Now.ClearTime().AddDays(1).AddHours(17),
"This is a future event about the ABP Framework and Microservices that is set for tomorrow."
)
{
Capacity = 1
}
futureEvent
);
}
}

Loading…
Cancel
Save