コード例 #1
0
        private void MockDapper()
        {
            var connectionFactory = Substitute.For <IConnectionFactory>();
            var connection        = Substitute.For <IDbConnection>();

            connectionFactory.Get().Returns(connection);
            _registry.AddSingleton(connectionFactory);
        }
コード例 #2
0
        public void Setup()
        {
            _configuration = new ConfigurationBuilder()
                             .SetBasePath(Directory.GetCurrentDirectory())
                             .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
                             .Build();

            var registry = new WorkerRegistry();

            registry.AddSingleton(_configuration);
            _container = new Container(registry);
        }