private async void CancelEditingCommandExecuted() { if (_isLocked) { return; } if (_isEditMode) { _event.EventStatus = EventStatuses.FirstOrDefault(p => p.ID == _originalEvent.Event.EventStatus.ID); _event.EventType = EventTypes.FirstOrDefault(p => p.ID == _originalEvent.Event.EventType.ID); _eventsDataUnit.EventsRepository.RevertAllChanges(); _event.Event.LockedUserID = null; await _eventsDataUnit.SaveChanges(); _event.RefreshItems(); } else { _eventsDataUnit.RevertChanges(); } }
public void InvalidCredentials() { // List all the event types from Authorize.Net that you could subscribe to in a web hook var webHook = InitWebHook(); // ERROR TEST: Add an Invalid APILoginId webHook.ApiLoginID += "_INVALID"; EventTypes eventTypes = null; try { eventTypes = webHook.ListEventTypes(); } catch (Exception err) { common.DisplayError(err); common.DisplayResponse(webHook); Assert.Fail("Exception from WebHook; Please see the output window for more information."); } if (eventTypes != null && eventTypes.Any()) { // see if we got an error in any of the event types var errorEventType = eventTypes.FirstOrDefault(p => p.IsError == true); if (errorEventType != null) { // we got an error in at least one of the event types common.DisplayError(errorEventType.Exception); // this is a success because we are expecting an error Assert.IsTrue(true, "Received an error from Authorize.Net because of invalid credentials."); } else { // no errors, we are good: Display the eventTypes and set the test as successful. common.DisplayItems(eventTypes); Assert.IsFalse(false, "Expecting an error from Authorize.Net for invalid credentials."); } } else { Assert.Fail("Expecting multiple Event Types: Returned null/empty"); } common.DisplayResponse(webHook); }
public void Initial() { EventTypes = _termStyleRepository.GetEventTypes(); SelectedEventType = EventTypes.FirstOrDefault(); AssignmentTypes = _termStyleRepository.GetAssignmentTypesWithInsertRules(); }