Ejemplo n.º 1
0
    public void CreateBucket(string bucketName)
    {
        CreateBucketSample createBucketSample = new CreateBucketSample();

        createBucketSample.CreateBucket(ProjectId, bucketName);
        SleepAfterBucketCreateUpdateDelete();
        TempBucketNames.Add(bucketName);
    }
Ejemplo n.º 2
0
    public BucketFixture()
    {
        ProjectId = Environment.GetEnvironmentVariable("GOOGLE_PROJECT_ID");
        if (string.IsNullOrWhiteSpace(ProjectId))
        {
            throw new Exception("You need to set the Environment variable 'GOOGLE_PROJECT_ID' with your Google Cloud Project's project id.");
        }
        // create simple bucket
        CreateBucket(BucketNameGeneric);

        // create regional bucket
        CreateRegionalBucketSample createRegionalBucketSample = new CreateRegionalBucketSample();

        createRegionalBucketSample.CreateRegionalBucket(ProjectId, BucketNameRegional, TestLocation, StorageClasses.Regional);
        SleepAfterBucketCreateUpdateDelete();
        TempBucketNames.Add(BucketNameRegional);

        //upload file to BucketName
        UploadFileSample uploadFileSample = new UploadFileSample();

        uploadFileSample.UploadFile(BucketNameGeneric, FilePath, FileName);

        Collect(FileName);
    }