コード例 #1
0
        public void ShouldDeleteEventRoomsForEvent()
        {
            Prop.ForAll <string, int, int>((token, selectionId, eventId) =>
            {
                var searchString = string.Format(",\"{0}\"", eventId);
                var eventRooms   = GetMockedEventRooms(3);

                _ministryPlatformService.Setup(m => m.GetPageViewRecords(It.IsAny <string>(), It.IsAny <string>(), searchString, "", 0)).Returns(eventRooms);

                var eventRoomIds = Conversions.BuildIntArrayFromKeyValue(eventRooms, "Event_Room_ID").ToArray();

                _ministryPlatformService.Setup(m => m.CreateSelection(It.IsAny <SelectionDescription>(), token)).Returns(selectionId);
                _ministryPlatformService.Setup(m => m.AddToSelection(selectionId, eventRoomIds, token));
                _ministryPlatformService.Setup(m => m.DeleteSelectionRecords(selectionId, token));
                _ministryPlatformService.Setup(m => m.DeleteSelection(selectionId, token));

                _fixture.DeleteEventRoomsForEvent(eventId, token);
                _ministryPlatformService.VerifyAll();
            }).QuickCheckThrowOnFailure();
        }