FirebaseRestTranslator 0.1.1

Package Description

Install-Package FirebaseRestTranslator -Version 0.1.1
dotnet add package FirebaseRestTranslator --version 0.1.1
<PackageReference Include="FirebaseRestTranslator" Version="0.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FirebaseRestTranslator --version 0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

FirebareRestTranslator

This is a small helper class that can be used to translate C#
dictionaries into the Firebase REST format so they be posted
to Firebase directly.

See the tests for usage.

    [Fact]
    public void Test_FirebaseTranslator_BoolValue()
    {
        var data = new Dictionary<string, object>()
        {
            ["myKey"] = false
        };
        var expectedJson = "{\"name\":\"Test_FirebaseTranslator\",\"fields\":{\"myKey\":{\"booleanValue\":false}}}";
        var result = Translator.Translate("Test_FirebaseTranslator", data);
        var actualJson = JsonConvert.SerializeObject(result);
        Assert.Equal(expectedJson, actualJson);
    }

FirebareRestTranslator

This is a small helper class that can be used to translate C#
dictionaries into the Firebase REST format so they be posted
to Firebase directly.

See the tests for usage.

    [Fact]
    public void Test_FirebaseTranslator_BoolValue()
    {
        var data = new Dictionary<string, object>()
        {
            ["myKey"] = false
        };
        var expectedJson = "{\"name\":\"Test_FirebaseTranslator\",\"fields\":{\"myKey\":{\"booleanValue\":false}}}";
        var result = Translator.Translate("Test_FirebaseTranslator", data);
        var actualJson = JsonConvert.SerializeObject(result);
        Assert.Equal(expectedJson, actualJson);
    }

  • .NETCoreApp 3.0

    • No dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.1.1 119 3/7/2020