public void ShouldThrowArgumentNullExceptionWithInvalidServiceCollection()
        {
            var testPlugin = new RoutingTestPlugin();

            Assert.Throws <ArgumentNullException>(() => testPlugin.DefaultServiceRegistrationDelegate(null));
            Assert.Throws <NullReferenceException>(() => testPlugin.RoutingServiceRegistrationDelegate(null));
        }
        public void ShouldHavePriorityWithDefaultValue()
        {
            var testPlugin = new RoutingTestPlugin();

            Assert.IsAssignableFrom <IDefaultRegistrationPlugin>(testPlugin);
            Assert.NotNull(testPlugin);
            Assert.Equal(-8000, testPlugin.Priority);
        }
        public void ShouldInvokeMethodOfTypeVoidWithValidServiceCollection()
        {
            var testPlugin        = new RoutingTestPlugin();
            var serviceCollection = new ServiceCollection();

            testPlugin.RoutingServiceRegistrationDelegate(serviceCollection);

            Assert.Contains(serviceCollection, s => s.ServiceType == typeof(IRoutingServices));
        }
        public void ShouldInvokeMethodOfTypeVoidWithValidServiceCollectionForDefaultRegistration()
        {
            var testPlugin        = new RoutingTestPlugin();
            var serviceCollection = new ServiceCollection();

            testPlugin.DefaultServiceRegistrationDelegate(serviceCollection);

            var methodReturnType = testPlugin.DefaultServiceRegistrationDelegate.Method.ReturnType.Name;

            Assert.True(methodReturnType == "Void");
            Assert.Contains(serviceCollection, s => s.ServiceType == typeof(JsonResultExecutor));
        }