当前位置: 首页>>代码示例>>C#>>正文


C# ILogger.Stub方法代码示例

本文整理汇总了C#中ILogger.Stub方法的典型用法代码示例。如果您正苦于以下问题:C# ILogger.Stub方法的具体用法?C# ILogger.Stub怎么用?C# ILogger.Stub使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ILogger的用法示例。


在下文中一共展示了ILogger.Stub方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Setup

 public void Setup()
 {
     executableProcess = MockRepository.GenerateMock<IExecutableProcess>();
     logger = MockRepository.GenerateMock<ILogger>();
     logger.Stub(x => x.Log(Arg<string>.Is.Anything));
     netshFirewallRuleNameAvailable = new NetshFirewallRuleNameAvailable(executableProcess, logger);
 }
开发者ID:rackerlabs,项目名称:openstack-guest-agents-windows-xenserver,代码行数:7,代码来源:NetshFirewallRuleNameAvailableSpec.cs

示例2: Setup

        public void Setup()
        {
            execProcess = MockRepository.GenerateMock<IExecutableProcess>();
            logger = MockRepository.GenerateMock<ILogger>();
            logger.Stub(x => x.Log(Arg<string>.Is.Anything));

            systemInformation = new SystemInformation(execProcess, logger);

            input = new String('x', 200) + @"Windows Boot Loader\n\n\n\n"
                        + new String('y', 200) + " {my unique identifier} "
                        + new string('z', 302);
        }
开发者ID:rackerlabs,项目名称:openstack-guest-agents-windows-xenserver-old,代码行数:12,代码来源:SystemInformationSpec.cs

示例3: Setup

        public void Setup()
        {
            logger = MockRepository.GenerateMock<ILogger>();
            finalizer = new Finalizer(logger);

            logger.Stub(x => x.Log(Arg<string>.Is.Anything));

            CreateFile("test.txt");
            Directory.CreateDirectory("test_directory");
            for (var i = 10; i < 10; i++)
            {
                CreateFile("test_directory\\test" + i + ".txt");
            }
        }
开发者ID:rackerlabs,项目名称:openstack-guest-agents-windows-xenserver-old,代码行数:14,代码来源:FinalizerSpec.cs

示例4: Setup

        public void Setup()
        {
            _agentUpdateInfo = "http://something.com/file.zip,544564abc453de787ad";

            _downloader = MockRepository.GenerateMock<IDownloader>();
            _checksumValidator = MockRepository.GenerateMock<IChecksumValidator>();
            _unzipper = MockRepository.GenerateMock<IUnzipper>();
            _installer = MockRepository.GenerateMock<IInstaller>();
            _finalizer = MockRepository.GenerateMock<IFinalizer>();
            _connectionChecker = MockRepository.GenerateMock<IConnectionChecker>();
            _sleeper = MockRepository.GenerateMock<ISleeper>();
            _logger = MockRepository.GenerateMock<ILogger>();
            _serviceRestarter = MockRepository.GenerateMock<IServiceRestarter>();
            _agentUpdateMessageHandler = new AgentUpdateMessageHandler();

            _logger.Stub(x => x.Log(Arg<string>.Is.Anything));

            _xentoolsUpdate = new XentoolsUpdate(_sleeper, _downloader, _checksumValidator, _unzipper, _installer, _finalizer, _serviceRestarter, _connectionChecker, _agentUpdateMessageHandler, _logger);
        }
开发者ID:rackerlabs,项目名称:openstack-guest-agents-windows-xenserver-old,代码行数:19,代码来源:XentoolsUpdateSpec.cs

示例5: Establish_context

        protected override void Establish_context()
        {
            base.Establish_context();

            _logger = MockRepository.GenerateStub<ILogger>();
            _dataSource =
                MockRepository.GenerateStub<IDataSource>();

            _businessService =
                new DIBusinessService(_logger, _dataSource);

            _logger.Stub(logger => logger.Log());

            _dataSource
                .Stub(dataSource => dataSource.GetData(44))
                .Return("from mock");

            _dataSource
                .Stub(dataSource => dataSource.GetData(1))
                .IgnoreArguments().Return("_not_ from mock");
        }
开发者ID:JamesBender,项目名称:Codestock2015,代码行数:21,代码来源:Tests.cs


注:本文中的ILogger.Stub方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。