Exemple #1
0
        public void SetNewLocation_GivenVisitorHasNoHistory_ExpectRandomRequested()
        {
            Visitor visitor = new Visitor();
            VisitorFairyTaleStrategy strategy =
                new VisitorFairyTaleStrategy(eventProducerMock.Object, fairyTaleClientMock.Object);

            strategy.SetNewLocation(visitor);

            fairyTaleClientMock.Verify(client => client.GetRandomFairyTale(), Times.Once);
            fairyTaleClientMock.Verify(client => client.GetNewFairyTaleLocation(It.IsAny <Guid>(),
                                                                                It.IsAny <List <Guid> >()), Times.Never);
        }
Exemple #2
0
        public void SetNewLocation_GivenVisitorHasRideAsLatestLocation_ExpectRandomRequested()
        {
            Visitor visitor  = new Visitor();
            RideDto location = new RideDto();

            location.LocationType = LocationType.RIDE;
            visitor.VisitedLocations.Add(DateTime.Now, location);
            VisitorFairyTaleStrategy strategy =
                new VisitorFairyTaleStrategy(eventProducerMock.Object, fairyTaleClientMock.Object);

            strategy.SetNewLocation(visitor);

            fairyTaleClientMock.Verify(client => client.GetRandomFairyTale(), Times.Once);
            fairyTaleClientMock.Verify(client => client.GetNewFairyTaleLocation(It.IsAny <Guid>(),
                                                                                It.IsAny <List <Guid> >()), Times.Never);
        }