示例#1
0
 private void DeleteAttributes(AwsClientDetails clientDetails)
 {
     using (var helper = new SimpleDBHelper(clientDetails))
     {
         helper.DeleteAttributes(DomainName, ItemName, AttributeNames);
         Log.LogMessage(MessageImportance.Normal, "Deleted Attributes {0} for Item {1}", Join(AttributeNames), ItemName);
     }
 }
示例#2
0
 private void PutAttribute(AwsClientDetails clientDetails)
 {
     using (var helper = new SimpleDBHelper(clientDetails))
     {
         helper.PutAttribute(DomainName, ItemName, AttributeName, Replace, AttributeValue);
         Log.LogMessage(MessageImportance.Normal, "Stored Attribute {0} for Item {1}", AttributeName, ItemName);
     }
 }
 private void CreateDomain(AwsClientDetails clientDetails)
 {
     using (var helper = new SimpleDBHelper(clientDetails))
     {
         helper.CreateDomain(DomainName);
         Log.LogMessage(MessageImportance.Normal, "Created SimpleDB Domain {0}", DomainName);
     }
 }
 private void DeleteDomain(AwsClientDetails clientDetails)
 {
     using (var helper = new SimpleDBHelper(clientDetails))
     {
         helper.DeleteDomain(DomainName);
         Log.LogMessage(MessageImportance.High, "Deleted SimpleDB Domain {0}", DomainName);
     }
 }
 private void PutAttribute(AwsClientDetails clientDetails)
 {
     using (var helper = new SimpleDBHelper(clientDetails))
     {
         helper.PutAttribute(DomainName, ItemName, AttributeName, Replace, AttributeValue);
         Log.LogMessage(MessageImportance.Normal, "Stored Attribute {0} for Item {1}", AttributeName, ItemName);
     }
 }
 private void GetAttribute(AwsClientDetails clientDetails)
 {
     using (var helper = new SimpleDBHelper(clientDetails))
     {
         AttributeValue = helper.GetAttribute(DomainName, ItemName, AttributeName);
         Log.LogMessage(MessageImportance.Normal, "Read Attribute {0} for Item {1}", AttributeName, ItemName);
     }
 }
 private void DeleteDomain(AwsClientDetails clientDetails)
 {
     using (var helper = new SimpleDBHelper(clientDetails))
     {
         helper.DeleteDomain(DomainName);
         Log.LogMessage(MessageImportance.High, "Deleted SimpleDB Domain {0}", DomainName);
     }
 }
 private void GetAttribute(AwsClientDetails clientDetails)
 {
     using (var helper = new SimpleDBHelper(clientDetails))
     {
         AttributeValue = helper.GetAttribute(DomainName, ItemName, AttributeName);
         Log.LogMessage(MessageImportance.Normal, "Read Attribute {0} for Item {1}", AttributeName, ItemName);
     }
 }
 private void DeleteAttributes(AwsClientDetails clientDetails)
 {
     using (var helper = new SimpleDBHelper(clientDetails))
     {
         helper.DeleteAttributes(DomainName, ItemName, AttributeNames);
         Log.LogMessage(MessageImportance.Normal, "Deleted Attributes {0} for Item {1}", Join(AttributeNames), ItemName);
     }
 }
        public void CreateDomain_Should_Succeed()
        {
            var store = new ClientDetailsStore();
            AwsClientDetails clientDetails = store.Load(Container);

            SimpleDBHelper helper = new SimpleDBHelper(clientDetails);

            const string domainName = "TestDomain";
            helper.CreateDomain(domainName);
        }
        public void DeleteAttributes_Should_Succeed()
        {
            var store = new ClientDetailsStore();
            AwsClientDetails clientDetails = store.Load(Container);

            SimpleDBHelper helper = new SimpleDBHelper(clientDetails);

            const string domainName = "TestDomain";
            const string itemName = "TesItem";
            const string attributeName = "attributeName";
            string expectedValue = DateTime.Now.ToLongTimeString();

            // Ensure the domain exists and store the test item.
            helper.CreateDomain(domainName);
            helper.PutAttribute(domainName, itemName, attributeName, true, expectedValue);

            helper.DeleteAttributes(domainName, itemName, new [] { attributeName });
        }
        public void PutAttrubute_Should_Succeed()
        {
            var store = new ClientDetailsStore();
            AwsClientDetails clientDetails = store.Load(Container);

            SimpleDBHelper helper = new SimpleDBHelper(clientDetails);

            const string domainName = "TestDomain";
            const string itemName = "TesItem";
            const string name = "attributeName";
            const bool replace = true;
            string value = DateTime.Now.ToLongTimeString();

            helper.PutAttribute(domainName, itemName, name, replace, value);
        }
        public void GetUnknownAttribute_Should_ReturnEmptyString()
        {
            var store = new ClientDetailsStore();
            AwsClientDetails clientDetails = store.Load(Container);

            SimpleDBHelper helper = new SimpleDBHelper(clientDetails);

            const string domainName = "TestDomain";
            const string itemName = "TesItem";
            const string attributeName = "UnknownAttributeThatDoesntExist";
            string expectedValue = string.Empty;

            // Ensure the domain exists and store the test item.
            helper.CreateDomain(domainName);

            string actualValue = helper.GetAttribute(domainName, itemName, attributeName);

            Assert.AreEqual(expectedValue, actualValue);
        }