Beispiel #1
0
        public ServiceBusArgumentsDisplayTests(ServiceBusArgumentsDisplayTestsFixture fixture)
            : base(fixture)
        {
            Waiters.WaitForAction(() => Dashboard.Api.IndexingQueueLength(limit: 1) == 0);

            _storageAccount = fixture.StorageAccount;
        }
Beispiel #2
0
        public DashboardTestFixture(bool cleanStorageAccount, string connectionString = null)
        {
            // "DashboardSiteExtensionLocation" should point to a root site extension directory (unzipped),
            // which is the directory where the "extension.xml" file lives.
            string dashboardLocation = GetFromConfigOrEnvironmentOrDefault("DashboardSiteExtensionLocation");

            dashboardLocation = Directory.GetDirectories(dashboardLocation, "?.*.*").SingleOrDefault();
            if (string.IsNullOrEmpty(dashboardLocation))
            {
                throw new Exception("Unable to find Dashboard site extension. Make sure you've configured 'DashboardSiteExtensionLocation' correctly.");
            }

            _storage           = new WebJobsStorageAccount(GetFromConfigOrEnvironmentOrDefault("StorageAccount"));
            _serviceBusAccount = GetFromConfigOrEnvironmentOrDefault("ServiceBusAccount");

            if (cleanStorageAccount)
            {
                _storage.Empty();
            }

            if (connectionString == null)
            {
                connectionString = _storage.ConnectionString;
            }

            _server = new DashboardServer(dashboardLocation, connectionString);
            _server.Start();
        }
Beispiel #3
0
        public FunctionWithInvocationsTests(FunctionWithInvocationsTestsFixture fixture) : base(fixture)
        {
            if (fixture.FunctionId == null)
            {
                Waiters.WaitForAction(() => Dashboard.Api.IndexingQueueLength(limit: 1) == 0);

                fixture.FunctionId  = fixture.StorageAccount.MethodInfoToFunctionDefinitionId(SingleFunction.FunctionMethodInfo);
                fixture.Invocations = fixture.StorageAccount.MethodInfoToInvocations(SingleFunction.FunctionMethodInfo);
            }

            _functionDefinitionId = fixture.FunctionId;
            _storageAccount       = fixture.StorageAccount;
            _invocations          = fixture.Invocations;
        }
Beispiel #4
0
 public CleanStorageAccountTests(DashboardTestFixture fixture)
     : base(fixture)
 {
     _storageAccount = fixture.StorageAccount;
 }