public void ShouldThrowArgumentNullExceptionWithInvalidServiceCollection() { var testPlugin = new HttpTestPlugin(); Assert.Throws <ArgumentNullException>(() => testPlugin.DefaultServiceRegistrationDelegate(null)); Assert.Throws <NullReferenceException>(() => testPlugin.ServiceRegistrationDelegate(null)); }
public void ShouldInvokeMethodOfTypeVoidWithValidServiceCollection() { var testPlugin = new HttpTestPlugin(); var serviceCollection = new ServiceCollection(); testPlugin.ServiceRegistrationDelegate(serviceCollection); Assert.Contains(serviceCollection, s => s.ServiceType == typeof(IOptions <>)); }