public async Task TestGetImportedDatabases()
        {
            // Arrange
            var logger             = LoggingHelper.GetLogger <DocumentationController>();
            var hostingEnvironment = HostingEnvironmentMocker.GetHostingEnvironment();
            var apiConfig          = new ApiConfig();
            var dbService          = new DbService(hostingEnvironment, apiConfig);
            var controller         = new DocumentationController(logger, dbService);

            // Act
            var response = await controller.GetImportedDatabasesAsync() as ObjectResult;

            var value = response.Value as IListResponse <ImportedDatabase>;

            // Assert
            Assert.False(value.DidError);
        }
        public async Task TestGetDatabaseDetailAsync()
        {
            // Arrange
            var logger             = LoggingHelper.GetLogger <DocumentationController>();
            var hostingEnvironment = HostingEnvironmentMocker.GetHostingEnvironment();
            var apiConfig          = new ApiConfig();
            var dbService          = new DbService(hostingEnvironment, apiConfig);
            var controller         = new DocumentationController(logger, dbService);
            var request            = new DbRequest
            {
                Name = "OnlineStore"
            };

            // Act
            var response = await controller.GetDatabaseDetailAsync(request) as ObjectResult;

            var value = response.Value as ISingleResponse <DatabaseDetail>;

            // Assert
            Assert.False(value.DidError);
        }
        public async Task TestImportDatabase()
        {
            // Arrange
            var logger             = LoggingHelper.GetLogger <DocumentationController>();
            var hostingEnvironment = HostingEnvironmentMocker.GetHostingEnvironment();
            var apiConfig          = new ApiConfig();
            var dbService          = new DbService(hostingEnvironment, apiConfig);
            var controller         = new DocumentationController(logger, dbService);
            var request            = new ImportDatabaseRequest
            {
                Name             = "OnlineStore",
                ConnectionString = "server=(local);database=OnlineStore;integrated security=yes;",
                ImportTables     = true,
                ImportViews      = true
            };

            // Act
            var response = await controller.ImportDatabaseAsync(request) as ObjectResult;

            var value = response.Value as ImportDatabaseResponse;

            // Assert
            Assert.False(value.DidError);
        }
        public async Task TestEditDescriptionAsync()
        {
            // Arrange
            var hostingEnvironment = HostingEnvironmentMocker.GetHostingEnvironment();
            var apiConfig          = new ApiConfig();
            var dbService          = new DbService(hostingEnvironment, apiConfig);
            var logger             = LoggingHelper.GetLogger <DocumentationController>();
            var controller         = new DocumentationController(logger, dbService);
            var request            = new DbRequest
            {
                Name        = "OnlineStore",
                Table       = "Warehouse.Product",
                Type        = "table",
                Description = "Products catalog (unit tests)"
            };

            // Act
            var response = await controller.EditDescriptionAsync(request) as ObjectResult;

            var value = response.Value as ISingleResponse <EditDescription>;

            // Assert
            Assert.False(value.DidError);
        }