public async Task PostStatusAsync(string text, long? inReplyToStatusId, IMediaItem[] mediaItems)
{
+ if (mediaItems == null)
+ throw new ArgumentNullException("mediaItems");
+
if (mediaItems.Length != 1)
throw new ArgumentOutOfRangeException("mediaItems");
throw new NotImplementedException();
if (!item.Exists)
- throw new ArgumentException("File isn't exists.", "mediaItems[0]");
+ throw new ArgumentException("Err:Media not found.");
XDocument xml;
try
public async Task PostStatusAsync(string text, long? inReplyToStatusId, IMediaItem[] mediaItems)
{
+ if (mediaItems == null)
+ throw new ArgumentNullException("mediaItems");
+
if (mediaItems.Length != 1)
throw new ArgumentOutOfRangeException("mediaItems");
var item = mediaItems[0];
+ if (item == null)
+ throw new ArgumentException("Err:Media not specified.");
+
if (!item.Exists)
- throw new ArgumentException("Err:File isn't exists.", "filePaths[0]");
+ throw new ArgumentException("Err:Media not found.");
var xml = await this.mobypictureApi.UploadFileAsync(item, text)
.ConfigureAwait(false);
public async Task PostStatusAsync(string text, long? inReplyToStatusId, IMediaItem[] mediaItems)
{
+ if (mediaItems == null)
+ throw new ArgumentNullException("mediaItems");
+
if (mediaItems.Length != 1)
throw new ArgumentOutOfRangeException("mediaItems");
var item = mediaItems[0];
+ if (item == null)
+ throw new ArgumentException("Err:Media not specified.");
+
if (!item.Exists)
- throw new ArgumentException("Err:File isn't exists.", "filePaths[0]");
+ throw new ArgumentException("Err:Media not found.");
var xml = await this.twippleApi.UploadFileAsync(item)
.ConfigureAwait(false);
public async Task PostStatusAsync(string text, long? inReplyToStatusId, IMediaItem[] mediaItems)
{
- if (mediaItems == null || mediaItems.Length == 0)
- throw new ArgumentException("Err:Media isn't specified.", "mediaItems");
+ if (mediaItems == null)
+ throw new ArgumentNullException("mediaItems");
+
+ if (mediaItems.Length == 0)
+ throw new ArgumentException("Err:Media not specified.");
foreach (var item in mediaItems)
{
if (item == null)
- throw new ArgumentException("Err:Media isn't specified.", "mediaItems");
+ throw new ArgumentException("Err:Media not specified.");
if (!item.Exists)
- throw new ArgumentException("Err:File isn't exists.", "mediaItems");
+ throw new ArgumentException("Err:Media not found.");
}
await Task.Run(() =>
public async Task PostStatusAsync(string text, long? inReplyToStatusId, IMediaItem[] mediaItems)
{
+ if (mediaItems == null)
+ throw new ArgumentNullException("mediaItems");
+
if (mediaItems.Length != 1)
throw new ArgumentOutOfRangeException("mediaItems");
var item = mediaItems[0];
+ if (item == null)
+ throw new ArgumentException("Err:Media not specified.");
+
if (!item.Exists)
- throw new ArgumentException("Err:File isn't exists.", "filePaths[0]");
+ throw new ArgumentException("Err:Media not found.");
var xml = await this.imglyApi.UploadFileAsync(item, text)
.ConfigureAwait(false);
public async Task PostStatusAsync(string text, long? inReplyToStatusId, IMediaItem[] mediaItems)
{
+ if (mediaItems == null)
+ throw new ArgumentNullException("mediaItems");
+
if (mediaItems.Length != 1)
throw new ArgumentOutOfRangeException("mediaItems");
var item = mediaItems[0];
+ if (item == null)
+ throw new ArgumentException("Err:Media not specified.");
+
if (!item.Exists)
- throw new ArgumentException("Err:File isn't exists.", "filePaths[0]");
+ throw new ArgumentException("Err:Media not found.");
var xml = await this.yfrogApi.UploadFileAsync(item, text)
.ConfigureAwait(false);