Ejemplo n.º 1
0
        public void SerializeMultipleEZStatsAsRequest()
        {
            var statList = new List <EZStat>()
            {
                new EZStat("TestStat", 1),
                new EZStat("TestStat", value: 1)
            };

            var ezRequest = new EZRequest("APIKey", statList);

            Assert.Equal("{ \"ezkey\": \"APIKey\", \"data\": [{ \"stat\": \"TestStat\", \"count\": 1 },{ \"stat\": \"TestStat\", \"value\": 1 }]}", ezRequest.ToString());
        }
Ejemplo n.º 2
0
    public void SerializeEnumerable()
    {
        var a = new EZRequest("a", Stats().ToArray());

        Assert.Equal("" "{" ezkey ":" a "," data ":[{" stat ":" counter "," count ":1},{" stat ":" counter "," count ":2}]}" "", a.ToString());
    }
Ejemplo n.º 3
0
        public void SerializeSingleEZRequest()
        {
            var ezRequestCount = new EZRequest("ApiKey", new EZStat("TestStat", 1));
            var ezRequestValue = new EZRequest("ApiKey", new EZStat("TestStat", value: 1));

            Assert.Equal("{ \"ezkey\": \"ApiKey\", \"data\": [{ \"stat\": \"TestStat\", \"count\": 1 }]}", ezRequestCount.ToString());
            Assert.Equal("{ \"ezkey\": \"ApiKey\", \"data\": [{ \"stat\": \"TestStat\", \"value\": 1 }]}", ezRequestValue.ToString());
        }
Ejemplo n.º 4
0
    public void SerializeMultipleEZTests()
    {
        var a = new EZRequest("a", new[] { new EZStat("counter", 0, 1), new EZStat("counter", 0, 2) });

        Assert.Equal("" "{" ezkey ":" a "," data ":[{" stat ":" counter "," value ":1},{" stat ":" counter "," value ":2}]}" "", a.ToString());
    }