public void ParseContacts_ContactBehaviorShouldBeStrictWalk()
        {
            var parser  = new XGenParser("http://google.com");
            var segment = parser.ParseContacts(this.GetContactsDefinition(), JobType.Contacts).Single();

            segment.Behavior().Should().BeOfType <StrictWalk>();
        }
        public void ParseContacts_ShouldParseEmail()
        {
            var parser  = new XGenParser("http://google.com");
            var segment = parser.ParseContacts(this.GetContactsDefinition(), JobType.Contacts).Single();

            segment.Behavior().Should().BeOfType <StrictWalk>();
            segment.VisitVariables.OfType <IdentifiedContactDataVariable>().Single().Email.Should().Be("*****@*****.**");
        }
Ejemplo n.º 3
0
        public IVisitSimulator CreateSimulator()
        {
            var parser = new XGenParser(RootUrl);

            if (Specification["Segments"].Any())
            {
                var segments = parser.ParseSegments(Specification["Segments"], Type);
                return(new SegmentBasedSimulator(segments));
            }
            return(new  ContactBasedSimulator(parser.ParseContacts(Specification["Contacts"], Type)));
        }
        public void ParseContacts_TestJson_ShouldNotFail()
        {
            var parser   = new XGenParser("http://google.com");
            var segments = parser.ParseContacts(JToken.Parse(TestJson)["Specification"]["Contacts"], JobType.Contacts);

            segments.Count().Should().Be(7);
            segments.All(x => x.Behavior().GetType() == typeof(StrictWalk)).Should().BeTrue();
            segments.All(x => x.VisitVariables.OfType <IdentifiedContactDataVariable>().Single().Email == "*****@*****.**").Should().BeTrue();

            DateTime.Now.Subtract(segments.First().DateGenerator.Start.Value).TotalDays.Should().BeGreaterOrEqualTo(0.91);
        }