コード例 #1
0
        public void BlobHelperGetShouldReturnTheCorrectObject()
        {
            var serializedKey = Serializer.SerializeToByteArray(TestString);
            var helper = new AzureBlobHelper(Account, ContainerName);
            helper.CreateOrUpdate(BlobId, serializedKey);

            var createdSuccessfully = helper.Exists(BlobId);
            createdSuccessfully.Should().BeTrue("The create or upload operation failed");

            var stream = helper.Get(BlobId);
            stream.Should().NotBeNull("Failed to get memory stream from blob");

            var deserializedObject = Serializer.DeserializeFromStream(stream);
            deserializedObject.Should().NotBeNull("Object was created successfully");
            
            TestString.ShouldBeEquivalentTo(deserializedObject);
        }