Пример #1
0
        public void Can_put_file()
        {
            var data = AwsTestHelpers.CreateRandomDocument();

            MockPlug.Setup(AwsTestHelpers.AWS.S3Uri)
            .Verb("PUT")
            .At(_config.RootedPath("foo", "bar"))
            .WithBody(data)
            .Returns(DreamMessage.Ok())
            .ExpectAtLeastOneCall();
            _client.PutFile("foo/bar", AwsTestHelpers.CreateFileHandle(data, null));
            MockPlug.VerifyAll();
        }
Пример #2
0
        public void Can_init_and_read_file()
        {
            var data = AwsTestHelpers.CreateRandomDocument();

            MockPlug.Setup(AwsTestHelpers.AWS.S3Uri)
            .Verb("GET")
            .At(_config.RootedPath("foo", "bar"))
            .Returns(DreamMessage.Ok(data))
            .ExpectAtLeastOneCall();
            var response = _storage.AtLocalHost.At("foo", "bar").Get(new Result <DreamMessage>()).Wait();

            Assert.IsTrue(response.IsSuccessful);
            Assert.AreEqual(data.ToCompactString(), response.ToDocument().ToCompactString());
        }