コード例 #1
0
        public void Should_not_override_channel_device_identifier()
        {
            var sourceToken  = new TrackingToken(Guid.NewGuid(), "push", "123");
            var sourceString = sourceToken.ToParsableString();

            var result = TrackingToken.Parse(sourceString, "web", "456");

            Assert.Equal(result, sourceToken);
        }
コード例 #2
0
        public void Should_parse_from_formatted_token_with_complex_device_identifier()
        {
            var sourceToken  = new TrackingToken(Guid.NewGuid(), "web", "a|very|complex|token");
            var sourceString = sourceToken.ToParsableString();

            var result = TrackingToken.Parse(sourceString);

            Assert.Equal(result, sourceToken);
        }
コード例 #3
0
        public void Should_parse_and_override_channel_and_device_identifier_if_not_set()
        {
            var sourceToken  = new TrackingToken(Guid.NewGuid());
            var sourceString = sourceToken.ToParsableString();

            var result = TrackingToken.Parse(sourceString, "push", "123");

            Assert.Equal(result, new TrackingToken(sourceToken.Id, "push", "123"));
        }
コード例 #4
0
        public void Should_parse_from_formatted_token_without_channel()
        {
            var sourceToken  = new TrackingToken(Guid.NewGuid());
            var sourceString = sourceToken.ToParsableString();

            var result = TrackingToken.Parse(sourceString);

            Assert.Equal(result, sourceToken);
        }