Пример #1
0
 public AddTraceWizard(IServiceProvider serviceProvider, TraceFailedRequestsItem existing, ConfigurationElement config, TraceFailedRequestsFeature feature)
     : base(serviceProvider)
 {
     _existing   = existing;
     _config     = config;
     _feature    = feature;
     _wizardData = new AddTraceWizardData(config, existing);
     InitializeComponent();
     TaskGlyph = Resources.trace_failed_requests_48;
 }
Пример #2
0
        private void SetUp()
        {
            const string Original     = @"original.config";
            const string OriginalMono = @"original.mono.config";

            if (Helper.IsRunningOnMono())
            {
                File.Copy("Website1/original.config", "Website1/web.config", true);
                File.Copy(OriginalMono, Current, true);
            }
            else
            {
                File.Copy("Website1\\original.config", "Website1\\web.config", true);
                File.Copy(Original, Current, true);
            }

            Environment.SetEnvironmentVariable(
                "JEXUS_TEST_HOME",
                Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));

            _server = new IisExpressServerManager(Current);

            _serviceContainer = new ServiceContainer();
            _serviceContainer.RemoveService(typeof(IConfigurationService));
            _serviceContainer.RemoveService(typeof(IControlPanel));
            var scope = ManagementScope.Server;

            _serviceContainer.AddService(typeof(IControlPanel), new ControlPanel());
            _serviceContainer.AddService(typeof(IConfigurationService),
                                         new ConfigurationService(null, _server.GetApplicationHostConfiguration(), scope, _server, null, null, null, null, null));

            _serviceContainer.RemoveService(typeof(IManagementUIService));
            var mock = new Mock <IManagementUIService>();

            mock.Setup(
                action =>
                action.ShowMessage(
                    It.IsAny <string>(),
                    It.IsAny <string>(),
                    It.IsAny <MessageBoxButtons>(),
                    It.IsAny <MessageBoxIcon>(),
                    It.IsAny <MessageBoxDefaultButton>())).Returns(DialogResult.Yes);
            _serviceContainer.AddService(typeof(IManagementUIService), mock.Object);

            var module = new TraceFailedRequestsModule();

            module.TestInitialize(_serviceContainer, null);

            _feature = new TraceFailedRequestsFeature(module);
            _feature.Load();
        }
Пример #3
0
        private void Tracing()
        {
            var feature = new TraceFailedRequestsFeature(Module);

            feature.Set();
        }