public void CanParseAccountWithValidJsonPayloadAndHeaders()
        {
            var accountName = "1234567890";
            var validSingleContainerJson = @"[
                                            {
                                                  ""count"": 1,
                                                  ""bytes"": 7,
                                                  ""name"": ""TestContainer""
                                            }]";

            var headers = new HttpHeadersAbstraction
            {
                {"X-Account-Bytes-Used", "12345"},
                {"X-Account-Object-Count", "1"},
                {"X-Account-Container-Count", "1"}
            };

            var converter = new StorageAccountPayloadConverter(new ServiceLocator());
            var account = converter.Convert(accountName, headers, validSingleContainerJson);

            Assert.IsNotNull(account);
            Assert.AreEqual(accountName, account.Name);
            Assert.AreEqual(12345, account.TotalBytesUsed);
            Assert.AreEqual(1, account.TotalObjectCount);
            Assert.AreEqual(1, account.TotalContainerCount);
            Assert.AreEqual(1, account.Containers.ToList().Count());
        }
        public void CannotParseAccountWithMissingBytesUsedHeader()
        {
            var accountName = "1234567890";
            var validSingleContainerJson = @"[
                                            {
                                                  ""count"": 1,
                                                  ""bytes"": 7,
                                                  ""name"": ""TestContainer""
                                            }]";

            var headers = new HttpHeadersAbstraction
            {
                {"X-Account-Object-Count", "1"},
                {"X-Account-Container-Count", "1"}
            };

            var converter = new StorageAccountPayloadConverter(new ServiceLocator());
            converter.Convert(accountName, headers, validSingleContainerJson);
        }
        public void CannotParseAccountWithNullPayload()
        {
            var accountName = "1234567890";

            var headers = new HttpHeadersAbstraction
            {
                {"X-Account-Bytes-Used", "12345"},
                {"X-Account-Object-Count", "1"},
                {"X-Account-Container-Count", "1"}
            };

            var converter = new StorageAccountPayloadConverter(new ServiceLocator());
            converter.Convert(accountName, headers, null);
        }
        public void CannotParseAccountWithNullHeaders()
        {
            var accountName = "1234567890";
            var validSingleContainerJson = @"[
                                            {
                                                  ""count"": 1,
                                                  ""bytes"": 7,
                                                  ""name"": ""TestContainer""
                                            }]";

            var converter = new StorageAccountPayloadConverter(new ServiceLocator());
            converter.Convert(accountName, null, validSingleContainerJson);
        }