public void Test_SharingTextObjectJsonReader_ReadObject_From_Json_String_Null() { var jsonReader = new SharingTextObjectJsonReader(); Func <Task <ITraktSharingText> > userSharingText = () => jsonReader.ReadObjectAsync(default(string)); userSharingText.Should().Throw <ArgumentNullException>(); }
public async Task Test_SharingTextObjectJsonReader_ReadObject_From_Json_String_Empty() { var jsonReader = new SharingTextObjectJsonReader(); var userSharingText = await jsonReader.ReadObjectAsync(string.Empty); userSharingText.Should().BeNull(); }
public async Task Test_SharingTextObjectJsonReader_ReadObject_From_Stream_Null() { var jsonReader = new SharingTextObjectJsonReader(); var userSharingText = await jsonReader.ReadObjectAsync(default(Stream)); userSharingText.Should().BeNull(); }
public async Task Test_SharingTextObjectJsonReader_ReadObject_From_JsonReader_Null() { var traktJsonReader = new SharingTextObjectJsonReader(); var userSharingText = await traktJsonReader.ReadObjectAsync(default(string)); userSharingText.Should().BeNull(); }
public async Task Test_TraktSharingText_From_Json() { var jsonReader = new SharingTextObjectJsonReader(); var sharingText = await jsonReader.ReadObjectAsync(JSON) as TraktSharingText; sharingText.Should().NotBeNull(); sharingText.Watching.Should().Be("I'm watching [item]"); sharingText.Watched.Should().Be("I just watched [item]"); }
public async Task Test_SharingTextObjectJsonReader_ReadObject_From_Json_String_Not_Valid_3() { var jsonReader = new SharingTextObjectJsonReader(); var userSharingText = await jsonReader.ReadObjectAsync(JSON_NOT_VALID_3); userSharingText.Should().NotBeNull(); userSharingText.Watching.Should().BeNull(); userSharingText.Watched.Should().BeNull(); }
public async Task Test_SharingTextObjectJsonReader_ReadObject_From_Json_String_Incomplete_2() { var jsonReader = new SharingTextObjectJsonReader(); var userSharingText = await jsonReader.ReadObjectAsync(JSON_INCOMPLETE_2); userSharingText.Should().NotBeNull(); userSharingText.Watching.Should().Be("I'm watching [item]"); userSharingText.Watched.Should().BeNull(); }
public async Task Test_SharingTextObjectJsonReader_ReadObject_From_Stream_Empty() { var jsonReader = new SharingTextObjectJsonReader(); using (var stream = string.Empty.ToStream()) { var userSharingText = await jsonReader.ReadObjectAsync(stream); userSharingText.Should().BeNull(); } }
public async Task Test_SharingTextObjectJsonReader_ReadObject_From_JsonReader_Empty() { var traktJsonReader = new SharingTextObjectJsonReader(); using (var reader = new StringReader(string.Empty)) using (var jsonReader = new JsonTextReader(reader)) { var userSharingText = await traktJsonReader.ReadObjectAsync(jsonReader); userSharingText.Should().BeNull(); } }
public async Task Test_SharingTextObjectJsonReader_ReadObject_From_Stream_Not_Valid_3() { var jsonReader = new SharingTextObjectJsonReader(); using (var stream = JSON_NOT_VALID_3.ToStream()) { var userSharingText = await jsonReader.ReadObjectAsync(stream); userSharingText.Should().NotBeNull(); userSharingText.Watching.Should().BeNull(); userSharingText.Watched.Should().BeNull(); } }
public async Task Test_SharingTextObjectJsonReader_ReadObject_From_Stream_Incomplete_1() { var jsonReader = new SharingTextObjectJsonReader(); using (var stream = JSON_INCOMPLETE_1.ToStream()) { var userSharingText = await jsonReader.ReadObjectAsync(stream); userSharingText.Should().NotBeNull(); userSharingText.Watching.Should().BeNull(); userSharingText.Watched.Should().Be("I just watched [item]"); } }
public async Task Test_SharingTextObjectJsonReader_ReadObject_From_JsonReader_Not_Valid_3() { var traktJsonReader = new SharingTextObjectJsonReader(); using (var reader = new StringReader(JSON_NOT_VALID_3)) using (var jsonReader = new JsonTextReader(reader)) { var userSharingText = await traktJsonReader.ReadObjectAsync(jsonReader); userSharingText.Should().NotBeNull(); userSharingText.Watching.Should().BeNull(); userSharingText.Watched.Should().BeNull(); } }
public async Task Test_SharingTextObjectJsonReader_ReadObject_From_JsonReader_Incomplete_2() { var traktJsonReader = new SharingTextObjectJsonReader(); using (var reader = new StringReader(JSON_INCOMPLETE_2)) using (var jsonReader = new JsonTextReader(reader)) { var userSharingText = await traktJsonReader.ReadObjectAsync(jsonReader); userSharingText.Should().NotBeNull(); userSharingText.Watching.Should().Be("I'm watching [item]"); userSharingText.Watched.Should().BeNull(); } }
public async Task Test_SharingTextObjectJsonReader_ReadObject_From_Stream_Null() { var jsonReader = new SharingTextObjectJsonReader(); Func <Task <ITraktSharingText> > userSharingText = () => jsonReader.ReadObjectAsync(default(Stream)); await userSharingText.Should().ThrowAsync <ArgumentNullException>(); }