public void CreateNullFactoryTypeThrowsArgumentNullException() { Assert.Throws <ArgumentNullException>(() => ProfilingAspect <ITestInterface> .Create( new MyTestInterface(), typeof(MyTestInterface), loggerFactory.Object, aspectConfigurationProvider, null)); }
/// <summary> /// The test initialize. /// </summary> public ProfilingAspectTests() { loggerFactory = new Mock <ILoggerFactory>(); logger = new Mock <ILogger>(); aspectConfigurationProvider = new InMemoryAspectConfigurationProvider(); var aspectConfiguration = new AspectConfiguration(new ServiceDescriptor(AspectRegistrationTests.IInterfaceType, AspectRegistrationTests.MyTestInterfaceType, ServiceLifetime.Transient)); aspectConfiguration.AddEntry(LoggingAspectFactory.LoggingAspectFactoryType, methodsToIntercept: AspectRegistrationTests.IInterfaceType.GetMethods()); aspectConfiguration.AddEntry(ProfilingAspectFactory.ProfilingAspectFactoryType, methodsToIntercept: AspectRegistrationTests.IInterfaceType.GetMethods()); aspectConfigurationProvider.AddEntry(aspectConfiguration); loggerFactory.Setup(x => x.CreateLogger(typeof(MyTestInterface).FullName)).Returns(logger.Object); instance = ProfilingAspect <ITestInterface> .Create( new MyTestInterface(), typeof(MyTestInterface), loggerFactory.Object, aspectConfigurationProvider, ProfilingAspectFactory.ProfilingAspectFactoryType); }