Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Injectable Processor will fail all tests #37

Open
ziachap opened this issue Apr 18, 2017 · 0 comments
Open

Injectable Processor will fail all tests #37

ziachap opened this issue Apr 18, 2017 · 0 comments

Comments

@ziachap
Copy link

ziachap commented Apr 18, 2017

The Debug assertion in InjectableProcessor will cause tests to fail when you try to use a mock service instead of an injected service in the processor. Quick fix is to remove that line but Andrew said it would be nice to have that line in the real world.

namespace Gibe.DittoProcessors.Processors
{
	public abstract class InjectableProcessorAttribute : TestableDittoProcessorAttribute
	{
		protected static Func<T> Inject<T>()
		{
			Debug.Assert(DependencyResolver.Current == null || DependencyResolver.Current.GetService<T>() != null);

			return () => DependencyResolver.Current.GetService<T>();
		}

		protected IPublishedContent Content => Value as IPublishedContent ?? Context.Content;
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant