/// <summary>Validates the deserialization result.</summary> private void CheckDeserializationResult(MockJsonSchema result) { Assert.NotNull(result); Assert.Equal("urlshortener#url", result.Kind); Assert.Equal("http://google.com/", result.LongURL); Assert.Null(result.Status); }
/// <summary>Validates the deserialization result.</summary> private void CheckDeserializationResult(MockJsonSchema result) { Assert.NotNull(result); Assert.That(result.Kind, Is.EqualTo("urlshortener#url")); Assert.That(result.LongURL, Is.EqualTo("http://google.com/")); Assert.That(result.Status, Is.Null); }
public void TestSerialization_WithoutDataWrapping() { const string Response = @"{""kind"":""urlshortener#url"",""longUrl"":""http://google.com/""}"; MockJsonSchema schema = new MockJsonSchema(); schema.Kind = "urlshortener#url"; schema.LongURL = "http://google.com/"; var client = CreateClientService(); // Check if a response is serialized correctly. string result = client.SerializeObject(schema); Assert.Equal(Response, result); }
public void TestSerializationV1() { const string ResponseV1 = @"{""kind"":""urlshortener#url"",""longUrl"":""http://google.com/""}"; MockJsonSchema schema = new MockJsonSchema(); schema.Kind = "urlshortener#url"; schema.LongURL = "http://google.com/"; IService impl = CreateV1Service(); // Check if a response is serialized correctly string result = impl.SerializeRequest(schema); Assert.AreEqual(ResponseV1, result); }
public void TestSerialization_WithDataWrapping() { const string Response = "{\"data\":{\"kind\":\"urlshortener#url\",\"longUrl\":\"http://google.com/\"}}"; MockJsonSchema schema = new MockJsonSchema(); schema.Kind = "urlshortener#url"; schema.LongURL = "http://google.com/"; var client = CreateClientService(Features.LegacyDataResponse); // Check if a response is serialized correctly string result = client.SerializeObject(schema); Assert.Equal(Response, result); }
public void TestSerializationV0_3() { const string ResponseV0_3 = "{\"data\":{\"kind\":\"urlshortener#url\",\"longUrl\":\"http://google.com/\"}}"; MockJsonSchema schema = new MockJsonSchema(); schema.Kind = "urlshortener#url"; schema.LongURL = "http://google.com/"; IService impl = CreateLegacyV03Service(); // Check if a response is serialized correctly string result = impl.SerializeRequest(schema); Assert.AreEqual(ResponseV0_3, result); }
public void TestSerializationV0_3() { const string ResponseV0_3 = "{\"data\":{\"kind\":\"urlshortener#url\",\"longUrl\":\"http://google.com/\"}}"; MockJsonSchema schema = new MockJsonSchema(); schema.Kind = "urlshortener#url"; schema.LongURL = "http://google.com/"; var client = CreateClientServiceV_03(); // Check if a response is serialized correctly string result = client.SerializeObject(schema); Assert.AreEqual(ResponseV0_3, result); }
public void TestSerialization_WithoutDataWrapping() { const string Response = @"{""kind"":""urlshortener#url"",""longUrl"":""http://google.com/""}"; MockJsonSchema schema = new MockJsonSchema(); schema.Kind = "urlshortener#url"; schema.LongURL = "http://google.com/"; var client = CreateClientService(); // Check if a response is serialized correctly. string result = client.SerializeObject(schema); Assert.AreEqual(Response, result); }
public void TestSerialization_WithDataWrapping() { const string Response = "{\"data\":{\"kind\":\"urlshortener#url\",\"longUrl\":\"http://google.com/\"}}"; MockJsonSchema schema = new MockJsonSchema(); schema.Kind = "urlshortener#url"; schema.LongURL = "http://google.com/"; var client = CreateClientService(Features.LegacyDataResponse); // Check if a response is serialized correctly string result = client.SerializeObject(schema); Assert.AreEqual(Response, result); }