public void ThresholdMinNotLessThanThresholdMaxGivesErrorForAbortEvent() { var viewModel = new EventEditorViewModel(fakeConfigService) { Type = EventType.Abort, ThresholdMin = 2, ThresholdMax = 1, }; Assert.NotEmpty(viewModel.GetErrors(nameof(viewModel.ThresholdMin))); Assert.NotEmpty(viewModel.GetErrors(nameof(viewModel.ThresholdMax))); }
public void AbortEventRequiresInputChannel() { var viewModel = new EventEditorViewModel(fakeConfigService) { Type = EventType.Abort, Channel = "Output" }; Assert.Single(viewModel.GetErrors(nameof(viewModel.Channel))); viewModel.Channel = "Input"; Assert.Empty(viewModel.GetErrors(nameof(viewModel.Channel))); }
public void FixingThresholdErrorMarksNoErrors() { var viewModel = new EventEditorViewModel(fakeConfigService) { Type = EventType.Abort, ThresholdMin = 2, ThresholdMax = 1, }; Assert.NotEmpty(viewModel.GetErrors(nameof(viewModel.ThresholdMin))); Assert.NotEmpty(viewModel.GetErrors(nameof(viewModel.ThresholdMax))); viewModel.ThresholdMin = 0; Assert.Empty(viewModel.GetErrors(nameof(viewModel.ThresholdMin))); Assert.Empty(viewModel.GetErrors(nameof(viewModel.ThresholdMax))); }
public void StartTimeMustBeNonNegative() { var viewModel = new EventEditorViewModel(fakeConfigService) { StartTime = TimeSpan.FromSeconds(-1) }; Assert.Single(viewModel.GetErrors(nameof(viewModel.StartTime))); }
public void ChannelInChannelOptionsCausesNoValidationError() { var viewModel = new EventEditorViewModel(fakeConfigService) { Channel = "Output" }; Assert.Empty(viewModel.GetErrors(nameof(viewModel.Channel))); }
public void ChannelNotInChannelOptionsCausesValidationError() { var viewModel = new EventEditorViewModel(fakeConfigService) { Channel = "Does not exist" }; Assert.NotEmpty(viewModel.GetErrors(nameof(viewModel.Channel))); }