GetContentAsJsonString() public method

public GetContentAsJsonString ( ) : string
return string
        public void then_the_request_should_return_the_body_as_null_when_not_present()
        {
            // Arrange
            var request = new PusherRestRequest("testUrl");

            // Act
            var jsonString = request.GetContentAsJsonString();

            // Assert
            Assert.IsNotNull(request);
            Assert.IsNull(jsonString);
        }
        public void then_the_request_should_return_the_body_as_a_string_when_present()
        {
            // Arrange
            var request = new PusherRestRequest("testUrl");

            // Act
            request.Body = _factory.Create("Test Property 1", 2, true);
            var jsonString = request.GetContentAsJsonString();

            // Assert
            Assert.IsNotNull(request);
            StringAssert.Contains("{\"Property1\":\"Test Property 1\",\"Property2\":2,\"Property3\":true}", jsonString);
        }