public void Response_CreateJson() { //--------------------------------------------- var response = ProfileResponse.Create(new JObject()); Assert.True(response.Success); Assert.Equal(ProfileStatus.OK, response.Status); Assert.Null(response.Value); Assert.NotNull(response.JObject); Assert.Empty(response.JObject.Properties()); Assert.Equal("OK-JSON: {}", response.ToString()); //--------------------------------------------- var jObj = new JObject( new JProperty("hello", "world!") ); response = ProfileResponse.Create(jObj); Assert.True(response.Success); Assert.Equal(ProfileStatus.OK, response.Status); Assert.Null(response.Value); Assert.NotNull(response.JObject); Assert.Single(response.JObject.Properties()); Assert.Equal("world!", response.JObject["hello"]); Assert.Equal("OK-JSON: {\"hello\":\"world!\"}", response.ToString()); }
public void Response_Create() { var response = ProfileResponse.Create("HELLO WORLD!"); Assert.True(response.Success); Assert.Equal("HELLO WORLD!", response.Value); Assert.Null(response.JObject); Assert.Equal("OK: HELLO WORLD!", response.ToString()); }