예제 #1
0
        public void CreateEventWithEmptyModel_ThrowsException()
        {
            var cmd     = new CreateEventCommand(_ctx);
            var request = new CreateEventRequest(new ReservationModel());

            Assert.Throws <ArgumentNullException>(() => cmd.Handle(request, CancellationToken.None).Wait());
        }
예제 #2
0
        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);
        }
예제 #3
0
        public void CreateEventWithoutRequest_ThrowsException()
        {
            var cmd = new CreateEventCommand(_ctx);

            Assert.Throws <ArgumentNullException>(() => cmd.Handle(null, CancellationToken.None).Wait());
        }