Exemple #1
0
        public void GetAssociatedProjectGeofences()
        {
            var projUid = Guid.NewGuid();

            DateTime firstCreatedUtc       = new DateTime(2017, 1, 1, 2, 30, 3);
            var      createAssociateEvent1 = new AssociateProjectGeofence
            {
                ProjectUID  = projUid,
                GeofenceUID = Guid.NewGuid(),
                ActionUTC   = firstCreatedUtc
            };
            var createAssociateEvent2 = new AssociateProjectGeofence
            {
                ProjectUID  = projUid,
                GeofenceUID = Guid.NewGuid(),
                ActionUTC   = firstCreatedUtc
            };

            this.ProjectRepo.StoreEvent(createAssociateEvent1).Wait();
            this.ProjectRepo.StoreEvent(createAssociateEvent2).Wait();
            var a = this.ProjectRepo.GetAssociatedGeofences(projUid.ToString());

            a.Wait();
            Assert.IsNotNull(a.Result, "Failed to get associated boundaries");
            Assert.AreEqual(2, a.Result.Count(), "Wrong number of boundaries retrieved");
        }
Exemple #2
0
        public void CreateAssociatedProjectGeofence_HappyPath()
        {
            var projUid = Guid.NewGuid();

            DateTime firstCreatedUtc      = new DateTime(2017, 1, 1, 2, 30, 3);
            var      createAssociateEvent = new AssociateProjectGeofence
            {
                ProjectUID  = projUid,
                GeofenceUID = Guid.NewGuid(),
                ActionUTC   = firstCreatedUtc
            };

            WriteEventToDb(createAssociateEvent, "Associate event not written");
        }