Beispiel #1
0
 public static async Task <T> ReadAsJsonAsync <T>(this BlobInfo self, StateMachineBase stm)
 {
     if (self == null)
     {
         throw new ArgumentNullException("self");
     }
     return(JsonConvert.DeserializeObject <T>(await self.ReadAllTextAsync(stm)));
 }
        public async Task ReadAllTextAsync()
        {
            var blobId = await PutTestBlob("a.txt", Encoding.UTF8.GetBytes("some text in a.txt"));

            var blobInfo = new BlobInfo(blobId, "a.txt");
            var stm      = new DummyStateMachine();

            stm.Store = _store;
            var result = await blobInfo.ReadAllTextAsync(stm);

            Assert.Equal("some text in a.txt", result);
        }