//TODO: Fix this - Error is 403 forbidden: EXTENSION_TO_MIME_TYPE is the problem I think, because it says
        //something regarding the text/plain content type and we try to upload something of type .txt (not sure)
        public void DetailedItemViewModelTests_HandleImagesInDescription_DownloadImage_Success()
        {
            var fileName = "DetailedItemViewModelTests_HandleImagesInDescription_" + Guid.NewGuid() + ".txt";

            var fileContentsBytes = new byte[2500];
            var rnd = new Random();

            rnd.NextBytes(fileContentsBytes);

            Api.Core.Connector.RestConnector.AwaitContinueOnCapturedContext = false;
            // simulating uploading a picture; using plain text to also test content randomness
            var attachment = EntityService.AttachToEntity(WorkspaceContext, _story, fileName, fileContentsBytes, "text/plain", new string[] { "owner_work_item" });

            Assert.IsNotNull(attachment.Id, "Attachment id shouldn't be null");
            Assert.AreEqual(WorkItem.SUBTYPE_STORY, attachment.owner_work_item.TypeName, "Mismatched attachment parent type");
            Assert.AreEqual(_story.Id, attachment.owner_work_item.Id, "Mismatched attachment parent id");

            var updatedStory = new Story(_story.Id);

            updatedStory.SetValue(CommonFields.Description,
                                  "<html><body>" +
                                  "<div style=\"\">" +
                                  "<img data-size-percentage=\"100\" src=\"" + WorkspaceContext.GetPath() + "/attachments/" + attachment.Id + "/" + fileName + "\" style=\"width:437px;height:303px;\" />" +
                                  "</div>" +
                                  "<p>&nbsp;</p>" +
                                  "</body></html>");
            updatedStory = EntityService.Update(WorkspaceContext, updatedStory, new[] { "name", "subtype", CommonFields.Description });

            var viewModel = new DetailedItemViewModel(updatedStory);

            viewModel.InitializeAsync().Wait();

            var path = DetailedItemViewModel.TempPath + WorkItem.SUBTYPE_STORY + updatedStory.Id + fileName;

            ValidateFileContents(path, fileContentsBytes);

            var fileInfo = new FileInfo(path);
            var expectedLastWriteTime = fileInfo.LastWriteTime;

            Thread.Sleep(1000);

            viewModel.RefreshCommand.Execute(null);

            fileInfo = new FileInfo(path);
            Assert.AreEqual(expectedLastWriteTime, fileInfo.LastWriteTime, "Downloaded attachement was modified by refresh");
        }