Esempio n. 1
0
        public void DeleteAsync_NullUri()
        {
            var storage = new AzureBlobStorage(Configuration);

            storage
            .Awaiting(s => s.DeleteAsync(null))
            .Should().Throw <ArgumentNullException>();
        }
Esempio n. 2
0
        public void PutAsync_NullStream()
        {
            var storage = new AzureBlobStorage(Configuration);

            storage
            .Awaiting(s => s.PutAsync(null, ".dat"))
            .Should().Throw <ArgumentNullException>();
        }
Esempio n. 3
0
        public void DeleteAsync_NotMyUri()
        {
            var storage = new AzureBlobStorage(Configuration);
            var uri     = new Uri("some://other/base/file.txt");

            storage
            .Awaiting(s => s.DeleteAsync(uri))
            .Should().Throw <ArgumentException>();
        }
Esempio n. 4
0
        public void DeleteAsync_RelativeUri()
        {
            var storage = new AzureBlobStorage(Configuration);
            var uri     = new Uri("relative/file.txt", UriKind.Relative);

            storage
            .Awaiting(s => s.DeleteAsync(uri))
            .Should().Throw <ArgumentException>();
        }
Esempio n. 5
0
        public void PutAsync_UnreadableStream()
        {
            var storage = new AzureBlobStorage(Configuration);
            var stream  = Mock.Of <Stream>(s => s.CanRead == false);

            storage
            .Awaiting(s => s.PutAsync(stream, ".dat"))
            .Should().Throw <ArgumentException>();
        }