public void CreateEventWithEmptyModel_ThrowsException() { var cmd = new CreateEventCommand(_ctx); var request = new CreateEventRequest(new ReservationModel()); Assert.Throws <ArgumentNullException>(() => cmd.Handle(request, CancellationToken.None).Wait()); }
private CreateEventResponse CreateEvent(EventTimeModel eventTimeModel, Guid?assetId = null) { CreateEventCommand cmd = new CreateEventCommand(_ctx); var model = new ReservationModel { Id = _eventId, ArticleId = _articleId, AssetId = assetId, Comment = _comment, HasUserAssetAssignment = _hasUserAssetAssignment, EventLocationComment = _locationComment, IsConfirmed = _isConfirmed, Purpose = _purposeId, TenantId = _tenantId, EventTime = eventTimeModel }; var request = new CreateEventRequest(model); var res = cmd.Handle(request, CancellationToken.None).Result; return(res); }
public void CreateEventWithoutRequest_ThrowsException() { var cmd = new CreateEventCommand(_ctx); Assert.Throws <ArgumentNullException>(() => cmd.Handle(null, CancellationToken.None).Wait()); }