public void should_throw_container_already_exists_exception()
        {
            var account = new MockCFAccount();

            Assert.That(account.ContainerExists("alreadyexistingcontainer"), Is.False);
            account.CreateContainer("alreadyexistingcontainer");
            Assert.That(account.ContainerExists("alreadyexistingcontainer"), Is.True);
            account.CreateContainer("alreadyexistingcontainer");

            Assert.Fail("Allowed CreateContainer to be called when container already existed");
        }
        public void should_return_json_string_with_container_names_and_item_count_and_bytes_used()
        {
            var account = new MockCFAccount();

            account.CreateContainer("container");
            const string expectedJson = "[{\"name\":[ ]?\"container\",[ ]?\"count\":[ ]?0,[ ]?\"bytes\":[ ]?0}]";

            Assert.That(account.JSON, Is.EqualTo(expectedJson));
        }
        public void should_return_xml_document_with_container_names_and_item_count_and_bytes_used()
        {
            var account = new MockCFAccount();

            account.CreateContainer("container");
            const string expectedXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><account name=\"MossoCloudFS_5d8f3dca-7eb9-4453-aa79-2eea1b980353\"><container><name>container</name><count>0</count><bytes>0</bytes></container></account>";

            Assert.That(account.XML.InnerXml, Is.EqualTo(expectedXml));
        }
        public void should_do_nothing_when_successful()
        {
            var account = new MockCFAccount();

            account.CreateContainer("testcontainername");
            Assert.That(account.ContainerExists("testcontainername"), Is.True);
            account.DeleteContainer("testcontainername");

            Assert.That(account.ContainerExists("testcontainername"), Is.False);
        }
        public void should_give_you_container_instance_when_successful()
        {
            var account = new MockCFAccount();

            Assert.That(account.ContainerExists("testcontainername"), Is.False);
            IContainer container = account.CreateContainer("testcontainername");

            Assert.That(account.ContainerExists("testcontainername"), Is.True);
            Assert.That(container.Name, Is.EqualTo("testcontainername"));
            Assert.That(account.ContainerCount, Is.EqualTo(1));
            Assert.That(account.BytesUsed, Is.EqualTo(34));
        }
Esempio n. 6
0
        public void should_give_you_container_instance_when_successful()
        {
            var account = new MockCFAccount();
            Assert.That(account.ContainerExists("testcontainername"), Is.False);
            IContainer container = account.CreateContainer("testcontainername");

            Assert.That(account.ContainerExists("testcontainername"), Is.True);
            Assert.That(container.Name, Is.EqualTo("testcontainername"));
            Assert.That(account.ContainerCount, Is.EqualTo(1));
            Assert.That(account.BytesUsed, Is.EqualTo(34));
        }
Esempio n. 7
0
        public void should_return_xml_document_with_container_names_and_item_count_and_bytes_used()
        {
            var account = new MockCFAccount();
            account.CreateContainer("container");
            var expectedXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><account name=\"MossoCloudFS_5d8f3dca-7eb9-4453-aa79-2eea1b980353\"><container><name>container</name><count>0</count><bytes>0</bytes></container></account>";

            Assert.That(account.XML.InnerXml, Is.EqualTo(expectedXml));
        }
Esempio n. 8
0
        public void should_return_json_string_with_container_names_and_item_count_and_bytes_used()
        {
            var account = new MockCFAccount();
            account.CreateContainer("container");
            var expectedJson = "[{\"name\": \"container\", \"count\": 0, \"bytes\": 0}]";

            Assert.That(account.JSON, Is.EqualTo(expectedJson));
        }
Esempio n. 9
0
        public void should_do_nothing_when_successful()
        {
            var account = new MockCFAccount();
            account.CreateContainer("testcontainername");
            Assert.That(account.ContainerExists("testcontainername"), Is.True);
            account.DeleteContainer("testcontainername");

            Assert.That(account.ContainerExists("testcontainername"), Is.False);
        }
Esempio n. 10
0
        public void should_throw_container_already_exists_exception()
        {
            var account = new MockCFAccount();
            Assert.That(account.ContainerExists("alreadyexistingcontainer"), Is.False);
            account.CreateContainer("alreadyexistingcontainer");
            Assert.That(account.ContainerExists("alreadyexistingcontainer"), Is.True);
            account.CreateContainer("alreadyexistingcontainer");

            Assert.Fail("Allowed CreateContainer to be called when container already existed");
        }