public void GetSessionInfoArgs_NullArgs()
        {
            var result = PiwikDataConverter.GetSessionInfoArgs(null);

            Assert.IsNotNull(result);
            Assert.IsFalse(result.Any());
        }
        public void GetSessionInfoArgs_MinimalArgs()
        {
            var info = new PiwikSessionInfo();

            var result = PiwikDataConverter.GetSessionInfoArgs(info);

            Assert.IsNotNull(result);
            AssertEqual(result, new[] { "_idvc=0" });
        }
 public void GetSessionInfoArgs_UniqueVisitorId_Less16()
 {
     PiwikDataConverter.GetSessionInfoArgs(new PiwikSessionInfo()
     {
         VisitsCount     = 123,
         UniqueVisitorId = "0123456789abcde",    //  Less than 16 characters.
         UserId          = "user id",
         FirstVisit      = new DateTimeOffset(1970, 1, 1, 0, 0, 5, TimeSpan.Zero),
         LastVisit       = new DateTimeOffset(1970, 1, 1, 0, 0, 40, TimeSpan.Zero)
     });
 }
        public void GetSessionInfoArgs_AllArgs()
        {
            var info = new PiwikSessionInfo()
            {
                VisitsCount     = 123,
                UniqueVisitorId = "0123456789abcdef",
                UserId          = "user id",
                FirstVisit      = new DateTimeOffset(1970, 1, 1, 0, 0, 5, TimeSpan.Zero),
                LastVisit       = new DateTimeOffset(1970, 1, 1, 0, 0, 40, TimeSpan.Zero)
            };

            var result = PiwikDataConverter.GetSessionInfoArgs(info);

            Assert.IsNotNull(result);
            AssertEqual(result, new[] { "cid=0123456789abcdef", "_idvc=123", "uid=user%20id", "_idts=5", "_viewts=40" });
        }