Exemple #1
0
        public void Test_DefaultUrlReposity_no_connection_string_return_empty()
        {
            string connectionString = "fake_connection_string";
            string sqlScript        = "SELECT TOP 1 url FROM click_server_urls WHERE default_p=1 AND server_id=@serverId";
            string retUrl           = "returnUrl";

            mockDatabaseProvider = new Mock <IDatabaseProvider>();
            mockDatabaseProvider.Setup(p => p.GetCellValue <string>(connectionString, sqlScript, It.IsAny <object>(), CommandType.Text)).Returns(retUrl);

            defaultUrlRepository = new DefaultUrlRepository(mockDatabaseProvider.Object);

            var connString = defaultUrlRepository.GetDefaultUrl(0, connectionString);

            Assert.Empty(connString);
        }
Exemple #2
0
 public DefaultUrlService(ICacheProvider cacheProvider, IOptions <CMAOptions> options, IDefaultUrlRepository defaultUrlRepository)
 {
     _cacheProvider        = cacheProvider;
     _options              = options;
     _defaultUrlRepository = defaultUrlRepository;
 }