示例#1
0
        public void AlertCanBeRaised()
        {
            Member         member = InsertMember();
            VisitTimeAlert alert  = InsertVisitTimeAlert(member);

            List <Member> membersToAlert = AlertCollection.ReadAlertCollections(_mongoConnection);

            CollectionAssert.AreEqual(new List <Member>()
            {
                member
            }, membersToAlert);
        }
示例#2
0
        public void VisitTimeAlertWillNotBeRaisedIfThereIsAVisit()
        {
            Member         member = InsertMember();
            VisitTimeAlert alert  = InsertVisitTimeAlert(member);

            Visit visit = InsertVisit(member);

            List <Member> membersToAlert = AlertCollection.ReadAlertCollections(_mongoConnection);

            CollectionAssert.AreEqual(new List <Member>()
            {
            }, membersToAlert);
        }
示例#3
0
        public void AlertsHaveAcceptablePerformance()
        {
            int insertGroupSize = 1000;
            int numberOfGroups  = 10;

            for (int createMemberIndex = 0; createMemberIndex < numberOfGroups; createMemberIndex++)
            {
                Member[] members = InsertMembers(insertGroupSize);

                InsertVisits(members, insertGroupSize, 24);
                InsertVisitTimeAlerts(members, insertGroupSize, 24);
            }

            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();

            List <Member> membersToAlert = AlertCollection.ReadAlertCollections(_mongoConnection);

            stopwatch.Stop();

            Console.Out.WriteLine($"found {membersToAlert.Count} in {stopwatch.Elapsed.TotalSeconds} Seconds");
            Assert.Less(stopwatch.Elapsed, TimeSpan.FromMinutes(1));
        }