public void ReturnRightEnumForType() { var webSource = new RecipeUrlSource(); var output = webSource.GetSourceType(); Assert.Equal(SourceType.WebSource, output); var cookbook = new RecipeCookbookSource(); output = cookbook.GetSourceType(); Assert.Equal(SourceType.Cookbook, output); var invalidSource = new InvalidSource(); Assert.Throws(typeof(ArgumentException), () => invalidSource.GetSourceType()); }
/// <summary> /// Event invocator for the <see cref="InvalidSource"/> event /// </summary> /// <param name="source">The <see cref="SubscriptionDataSource"/> that was invalid</param> /// <param name="exception">The exception if one was raised, otherwise null</param> private void OnInvalidSource(SubscriptionDataSource source, Exception exception) { InvalidSource?.Invoke(this, new InvalidSourceEventArgs(source, exception)); }