public async Task UploadAsync_WhenCalled_ShouldCreateAttachment() { var byteArray = Encoding.UTF8.GetBytes("Hi there guys!"); var stream = new MemoryStream(byteArray); var response = await _resource .UploadAsync("crash.log", stream, "6bk3gql82em5nmf"); Assert.Equal("6bk3gql82em5nmf", response.Token); Assert.Equal("text/plain", response.Attachment.ContentType); Assert.Equal(new MemoryStream(byteArray).Length, response.Attachment.Size); }
public async Task ShouldGetAttachmentById() { var byteArray = Encoding.UTF8.GetBytes("Hi there guys!"); var stream = new MemoryStream(byteArray); var response = await _resource .UploadAsync("crash.log", stream, "6bk3gql82em5nmf"); var attachment = await _resource.GetAsync(response.Attachment.Id.Value); Assert.Equal(JsonConvert.SerializeObject(response.Attachment), JsonConvert.SerializeObject(attachment)); }