mirror of https://github.com/abpframework/eventhub
5 changed files with 46 additions and 9 deletions
@ -0,0 +1,28 @@ |
|||
using System; |
|||
using Shouldly; |
|||
using Volo.Abp; |
|||
using Xunit; |
|||
|
|||
namespace EventHub.Events |
|||
{ |
|||
public class EventTests |
|||
{ |
|||
[Fact] |
|||
public void Should_Not_Allow_End_Time_To_Be_Earlier_Than_Start_Time() |
|||
{ |
|||
var exception = Assert.Throws<BusinessException>(() => |
|||
{ |
|||
new Event( |
|||
Guid.NewGuid(), |
|||
Guid.NewGuid(), |
|||
"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." |
|||
); |
|||
}); |
|||
|
|||
exception.Code.ShouldBe(EventHubErrorCodes.EventEndTimeCantBeEarlierThanStartTime); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue