Ejemplo n.º 1
0
        public void CreateBucket()
        {
            string testBucketName = "UnitTestBucket";
            var api = new ServiceStackB2Api();

            var returnBucket = api.CreateBucket(testBucketName, true);
            Assert.AreEqual(returnBucket.BucketName, testBucketName);
            Assert.AreEqual(returnBucket.AccountId, api.GetApplicationCredentials().AccountId);
            Assert.AreEqual(returnBucket.BucketType, "allPrivate");
        }
Ejemplo n.º 2
0
        public void ListBuckets()
        {
            string testBucketName = "ListBucketsTestBucket";
            var api = new ServiceStackB2Api();

            var createdBucket = api.CreateBucket(testBucketName, true);

            Assert.AreEqual(createdBucket.BucketName, testBucketName);
            Assert.AreEqual(createdBucket.AccountId, api.GetApplicationCredentials().AccountId);
            Assert.AreEqual(createdBucket.BucketType, "allPrivate");

            var listBuckets = api.ListBuckets();
            var testBucket = listBuckets.Buckets.FirstOrDefault(b => b.BucketName == createdBucket.BucketName);

            Assert.AreEqual(testBucket.BucketName, createdBucket.BucketName);
            Assert.AreEqual(testBucket.BucketType, createdBucket.BucketType);
            Assert.AreEqual(testBucket.AccountId, createdBucket.AccountId);
            Assert.AreEqual(testBucket.BucketId, createdBucket.BucketId);
        }
Ejemplo n.º 3
0
        public void SetUp()
        {
            client = new ServiceStackB2Api();

            //todo: I should not have to re-auth here, what's wrong with this design?
            creds = client.GetApplicationCredentials();
        }