Esempio n. 1
0
        public void CreateReportFilter_DuplicateNamesAreValid()
        {
            var custUid = Guid.NewGuid();
            var projUid = Guid.NewGuid();

            DateTime firstCreatedUtc          = new DateTime(2017, 1, 1, 2, 30, 3);
            var      createReportFilterEvent1 = new CreateFilterEvent
            {
                CustomerUID = custUid,
                ProjectUID  = projUid,
                UserID      = TestUtility.UIDs.JWT_USER_ID,
                FilterUID   = Guid.NewGuid(),
                Name        = "HasAName",
                FilterType  = FilterType.Report,
                FilterJson  = "blah1",
                ActionUTC   = firstCreatedUtc
            };

            var createReportFilterEvent2 = new CreateFilterEvent
            {
                CustomerUID = custUid,
                ProjectUID  = projUid,
                UserID      = TestUtility.UIDs.JWT_USER_ID,
                FilterUID   = Guid.NewGuid(),
                Name        = "HasAName",
                FilterType  = FilterType.Report,
                FilterJson  = "blah2",
                ActionUTC   = firstCreatedUtc
            };

            WriteEventToDb(createReportFilterEvent1);
            WriteEventToDb(createReportFilterEvent2);
        }
Esempio n. 2
0
        public void DeletePersistentFilter_HappyPath(FilterType filterType)
        {
            DateTime firstCreatedUtc   = new DateTime(2017, 1, 1, 2, 30, 3);
            var      createFilterEvent = new CreateFilterEvent
            {
                CustomerUID = Guid.NewGuid(),
                ProjectUID  = Guid.NewGuid(),
                UserID      = Guid.NewGuid().ToString(),
                FilterUID   = Guid.NewGuid(),
                Name        = "hasOne",
                FilterType  = filterType,
                FilterJson  = "blah",
                ActionUTC   = firstCreatedUtc
            };

            var deleteFilterEvent = new DeleteFilterEvent
            {
                CustomerUID = createFilterEvent.CustomerUID,
                ProjectUID  = createFilterEvent.ProjectUID,
                UserID      = createFilterEvent.UserID,
                FilterUID   = createFilterEvent.FilterUID,
                ActionUTC   = firstCreatedUtc.AddMinutes(2)
            };

            this.FilterRepo.StoreEvent(createFilterEvent).Wait();

            WriteEventToDb(deleteFilterEvent, "Filter event not deleted");

            var g = this.FilterRepo.GetFilter(createFilterEvent.FilterUID.ToString());

            g.Wait();
            Assert.IsNull(g.Result, "Should not be able to retrieve filter from filterRepo");
        }
Esempio n. 3
0
        public async Task GetFilterExecutor_Should_not_alter_existing_start_end_dates(int dateRangeType, bool asAtDate)
        {
            const string startDate = "2017-12-10T08:00:00Z";
            const string endDate   = "2017-12-10T20:09:59.108671Z";

            var filterType = FilterType.Transient;
            var name       = $"dateRangeType={dateRangeType},asAtDate={asAtDate}";

            var filterCreateEvent = new CreateFilterEvent
            {
                CustomerUID = Guid.NewGuid(),
                UserID      = TestUtility.UIDs.JWT_USER_ID,
                ProjectUID  = TestUtility.UIDs.MOCK_WEB_API_DIMENSIONS_PROJECT_UID,
                FilterUID   = Guid.NewGuid(),
                Name        = name,
                FilterType  = filterType,
                FilterJson  = $"{{\"startUtc\": \"{startDate}\",\"endUtc\": \"{endDate}\",\"dateRangeType\": {dateRangeType}, \"asAtDate\":\"{asAtDate}\"}}",
                ActionUTC   = DateTime.UtcNow
            };

            WriteEventToDb(filterCreateEvent);

            var request = CreateAndValidateRequest(customerUid: filterCreateEvent.CustomerUID.ToString(), userId: filterCreateEvent.UserID, projectUid: filterCreateEvent.ProjectUID.ToString(), filterUid: filterCreateEvent.FilterUID.ToString(), filterType: filterType, name: name);

            var projectData = new ProjectData {
                ProjectUID = filterCreateEvent.ProjectUID.ToString(), IanaTimeZone = "America/Los_Angeles"
            };

            var tcs = new TaskCompletionSource <List <ProjectData> >();

            tcs.SetResult(new List <ProjectData> {
                projectData
            });

            var projectProxy = new Mock <IProjectProxy>();

            projectProxy.Setup(x => x.GetProjects(filterCreateEvent.CustomerUID.ToString(), request.CustomHeaders)).Returns(() => tcs.Task);

            var executor = RequestExecutorContainer.Build <GetFilterExecutor>(ConfigStore, Logger, ServiceExceptionHandler, FilterRepo, null, projectProxy.Object);
            var result   = await executor.ProcessAsync(request) as FilterDescriptorSingleResult;

            Assert.IsNotNull(result, Responses.ShouldReturnResult);
            Assert.AreEqual(filterCreateEvent.FilterUID, Guid.Parse(result.FilterDescriptor.FilterUid), Responses.IncorrectFilterDescriptorFilterUid);

            dynamic filterObj = JsonConvert.DeserializeObject(result.FilterDescriptor.FilterJson);

            if (asAtDate)
            {
                Assert.IsNull(filterObj.startUtc);
            }
            else
            {
                Assert.AreEqual(DateTime.Parse(startDate).ToUniversalTime(), DateTime.Parse(filterObj.startUtc.ToString()));
            }

            Assert.AreEqual((DateTime.Parse(endDate).ToUniversalTime()).ToString(), filterObj.endUtc.ToString());
        }
Esempio n. 4
0
        public void GetFiltersExecutor_Should_add_start_end_dates(int dateRangeType, bool asAtDate)
        {
            var filterCreateEvent = new CreateFilterEvent
            {
                CustomerUID = Guid.NewGuid(),
                UserID      = TestUtility.UIDs.JWT_USER_ID,
                ProjectUID  = TestUtility.UIDs.MOCK_WEB_API_DIMENSIONS_PROJECT_UID,
                FilterUID   = Guid.NewGuid(),
                Name        = $"dateRangeType={dateRangeType},asAtDate={asAtDate}",
                FilterType  = FilterType.Persistent,
                FilterJson  = $"{{\"startUtc\": null,\"endUtc\": null,\"dateRangeType\": {dateRangeType}, \"asAtDate\":\"{asAtDate}\"}}",
                ActionUTC   = DateTime.UtcNow
            };

            WriteEventToDb(filterCreateEvent);

            var projectData = new ProjectData {
                ProjectUID = filterCreateEvent.ProjectUID.ToString(), IanaTimeZone = "America/Los_Angeles"
            };

            var request = CreateAndValidateRequest(customerUid: filterCreateEvent.CustomerUID.ToString(), userId: filterCreateEvent.UserID, projectData: projectData, filterUid: filterCreateEvent.FilterUID.ToString());

            var tcs = new TaskCompletionSource <List <ProjectData> >();

            tcs.SetResult(new List <ProjectData> {
                projectData
            });

            var projectProxy = new Mock <IProjectProxy>();

            projectProxy.Setup(x => x.GetProjects(filterCreateEvent.CustomerUID.ToString(), request.CustomHeaders)).Returns(() => tcs.Task);
            var executor = RequestExecutorContainer.Build <GetFiltersExecutor>(ConfigStore, Logger, ServiceExceptionHandler, FilterRepo, null, projectProxy.Object);
            var result   = executor.ProcessAsync(request).Result as FilterDescriptorListResult;

            Assert.IsNotNull(result, Responses.ShouldReturnResult);
            Assert.AreEqual(filterCreateEvent.FilterUID, Guid.Parse(result.FilterDescriptors[0].FilterUid), Responses.IncorrectFilterDescriptorFilterUid);

            dynamic filterObj = JsonConvert.DeserializeObject(result.FilterDescriptors[0].FilterJson);

            if (asAtDate)
            {
                Assert.IsNull(filterObj.StartUtc);
            }
            else
            {
                Assert.IsTrue(DateTime.TryParse(filterObj.startUtc.ToString(), out DateTime _));
            }
            Assert.IsTrue(DateTime.TryParse(filterObj.endUtc.ToString(), out DateTime _));
        }
Esempio n. 5
0
        public void UpdateTransientFilter_UnhappyPath()
        {
            DateTime firstCreatedUtc   = new DateTime(2017, 1, 1, 2, 30, 3);
            var      createFilterEvent = new CreateFilterEvent
            {
                CustomerUID = Guid.NewGuid(),
                ProjectUID  = Guid.NewGuid(),
                UserID      = TestUtility.UIDs.JWT_USER_ID,
                FilterUID   = Guid.NewGuid(),
                Name        = string.Empty,
                FilterType  = FilterType.Transient,
                FilterJson  = "blah",
                ActionUTC   = firstCreatedUtc
            };

            var updateFilterEvent = new UpdateFilterEvent
            {
                CustomerUID = createFilterEvent.CustomerUID,
                ProjectUID  = createFilterEvent.ProjectUID,
                UserID      = createFilterEvent.UserID,
                FilterUID   = createFilterEvent.FilterUID,
                Name        = string.Empty,
                FilterType  = FilterType.Transient,
                FilterJson  = "blahDeBlah",
                ActionUTC   = firstCreatedUtc.AddMinutes(2)
            };

            var filter = new Filter
            {
                CustomerUid     = createFilterEvent.CustomerUID.ToString(),
                ProjectUid      = createFilterEvent.ProjectUID.ToString(),
                UserId          = createFilterEvent.UserID,
                FilterUid       = createFilterEvent.FilterUID.ToString(),
                Name            = createFilterEvent.Name,
                FilterType      = createFilterEvent.FilterType,
                FilterJson      = createFilterEvent.FilterJson,
                LastActionedUtc = createFilterEvent.ActionUTC
            };

            this.FilterRepo.StoreEvent(createFilterEvent).Wait();

            WriteEventToDb(updateFilterEvent, "Filter event should not be updated", 0);

            var g = this.FilterRepo.GetFilter(createFilterEvent.FilterUID.ToString());

            g.Wait();
            Assert.IsNotNull(g.Result, "Unable to retrieve filter from filterRepo");
            Assert.AreEqual(filter, g.Result, "retrieved filter is incorrect");
        }
Esempio n. 6
0
        /// <summary>
        /// Create an instance of the master data events. Convert to JSON.
        /// </summary>
        /// <param name="eventObject">event to be published</param>
        /// <returns>json string with event serialized</returns>
        private string BuildEventIntoObject(dynamic eventObject)
        {
            var    jsonString = string.Empty;
            string eventType  = eventObject.EventType;

            switch (eventType)
            {
            case "CreateFilterEvent":
                var createFilterEvent = new CreateFilterEvent
                {
                    ActionUTC   = EventDate,
                    FilterUID   = eventObject.FilterUID,
                    CustomerUID = eventObject.CustomerUID,
                    ProjectUID  = eventObject.ProjectUID,
                    UserID      = eventObject.UserID,
                    FilterJson  = eventObject.FilterJson,
                    FilterType  = eventObject.FilterType
                };
                jsonString = JsonConvert.SerializeObject(new { CreateFilterEvent = createFilterEvent }, JsonSettings);
                break;

            case "UpdateFilterEvent":
                var updateFilterEvent = new UpdateFilterEvent
                {
                    ActionUTC   = EventDate,
                    FilterUID   = eventObject.FilterUID,
                    CustomerUID = eventObject.CustomerUID,
                    ProjectUID  = eventObject.ProjectUID,
                    UserID      = eventObject.UserID,
                    FilterJson  = eventObject.FilterJson,
                    FilterType  = eventObject.FilterType
                };
                jsonString = JsonConvert.SerializeObject(new { UpdateFilterEvent = updateFilterEvent }, JsonSettings);
                break;

            case "DeleteFilterEvent":
                var deleteFilterEvent = new DeleteFilterEvent
                {
                    ActionUTC   = EventDate,
                    FilterUID   = eventObject.FilterUID,
                    CustomerUID = eventObject.CustomerUID,
                    ProjectUID  = eventObject.ProjectUID,
                    UserID      = eventObject.UserID,
                };
                jsonString = JsonConvert.SerializeObject(new { DeleteFilterEvent = deleteFilterEvent }, JsonSettings);
                break;
            }
            return(jsonString);
        }
Esempio n. 7
0
        public void UpdatePersistentFilter_OutOfOrder(FilterType filterType)
        {
            DateTime firstCreatedUtc   = new DateTime(2017, 1, 1, 2, 30, 3);
            var      createFilterEvent = new CreateFilterEvent
            {
                CustomerUID = Guid.NewGuid(),
                ProjectUID  = Guid.NewGuid(),
                UserID      = Guid.NewGuid().ToString(),
                FilterUID   = Guid.NewGuid(),
                Name        = "persistent",
                FilterType  = filterType,
                FilterJson  = "blah",
                ActionUTC   = firstCreatedUtc
            };

            var updateFilterEvent = new UpdateFilterEvent
            {
                CustomerUID = createFilterEvent.CustomerUID,
                ProjectUID  = createFilterEvent.ProjectUID,
                UserID      = createFilterEvent.UserID,
                FilterUID   = createFilterEvent.FilterUID,
                Name        = "changed",
                FilterType  = filterType,
                FilterJson  = "blahDeBlah",
                ActionUTC   = firstCreatedUtc.AddMinutes(2)
            };

            var filter = new Filter
            {
                CustomerUid     = createFilterEvent.CustomerUID.ToString(),
                ProjectUid      = createFilterEvent.ProjectUID.ToString(),
                UserId          = createFilterEvent.UserID,
                FilterUid       = createFilterEvent.FilterUID.ToString(),
                Name            = updateFilterEvent.Name,
                FilterType      = createFilterEvent.FilterType,
                FilterJson      = updateFilterEvent.FilterJson,
                LastActionedUtc = updateFilterEvent.ActionUTC
            };

            WriteEventToDb(updateFilterEvent, "Filter event should be created with the update");
            WriteEventToDb(createFilterEvent, "Filter event should not be updated with the create", 0);

            var g = this.FilterRepo.GetFilter(createFilterEvent.FilterUID.ToString());

            g.Wait();
            Assert.IsNotNull(g.Result, "Unable to retrieve filter from filterRepo");
            Assert.AreEqual(filter, g.Result, "retrieved filter is incorrect");
        }
Esempio n. 8
0
        public async Task UpsertFilterExecutor_Persistent_ExistingName_FilterUidProvided_ChangeJson()
        {
            //Note: this test only applies to persistent filters not report filters.
            //Report filters are allowed duplicate names.

            var    custUid           = Guid.NewGuid();
            var    userId            = Guid.NewGuid();
            var    projectUid        = Guid.NewGuid();
            var    filterUid1        = Guid.NewGuid();
            var    filterUid2        = Guid.NewGuid();
            string name              = "theName";
            string filterJson        = "{\"designUID\":\"c2e5940c-4370-4d23-a930-b5b74a9fc22b\",\"contributingMachines\":[{\"assetID\":\"123456789\",\"machineName\":\"TheMachineName\",\"isJohnDoe\":false,\"assetUid\":null}]}";
            string filterJsonUpdated = "{\"designUID\":\"c2e5940c-4370-4d23-a930-b5b74a9fc22b\",\"onMachineDesignID\":null,\"elevationType\":3,\"vibeStateOn\":true}";
            var    filterType        = FilterType.Persistent;

            var filterEvent = new CreateFilterEvent
            {
                CustomerUID = custUid,
                UserID      = userId.ToString(),
                ProjectUID  = projectUid,
                FilterUID   = filterUid1,
                Name        = name,
                FilterType  = filterType,
                FilterJson  = filterJson,
                ActionUTC   = DateTime.UtcNow
            };

            WriteEventToDb(filterEvent);

            filterEvent.FilterUID = filterUid2;
            filterEvent.Name      = "something else";

            WriteEventToDb(filterEvent);

            // now try to change the 2nd filter to the name of the first
            var request = FilterRequestFull.Create(new HeaderDictionary(), custUid.ToString(), false, userId.ToString(), new ProjectData {
                ProjectUID = projectUid.ToString()
            }, new FilterRequest {
                FilterUid = filterUid2.ToString(), Name = name, FilterJson = filterJsonUpdated, FilterType = filterType
            });
            var ex = await Assert.ThrowsExceptionAsync <ServiceException>(async() => await executor.ProcessAsync(request)).ConfigureAwait(false);

            var content = ex.GetContent;

            Assert.AreNotEqual(-1, content.IndexOf("2039", StringComparison.Ordinal), "executor threw exception but incorrect code");
            Assert.AreNotEqual(-1, content.IndexOf("UpsertFilter failed. Unable to add persistent filter as Name already exists.", StringComparison.Ordinal), "executor threw exception but incorrect messaage");
        }
Esempio n. 9
0
        public void CreateTransientFilter_HappyPath(string filterName)
        {
            DateTime firstCreatedUtc   = new DateTime(2017, 1, 1, 2, 30, 3);
            var      createFilterEvent = new CreateFilterEvent
            {
                CustomerUID = Guid.NewGuid(),
                UserID      = Guid.NewGuid().ToString(),
                ProjectUID  = Guid.NewGuid(),
                FilterUID   = Guid.NewGuid(),
                Name        = filterName,
                FilterType  = FilterType.Transient,
                FilterJson  = "blah",
                ActionUTC   = firstCreatedUtc
            };

            var filter = new Filter
            {
                CustomerUid     = createFilterEvent.CustomerUID.ToString(),
                ProjectUid      = createFilterEvent.ProjectUID.ToString(),
                UserId          = createFilterEvent.UserID,
                FilterUid       = createFilterEvent.FilterUID.ToString(),
                Name            = createFilterEvent.Name,
                FilterType      = createFilterEvent.FilterType,
                FilterJson      = createFilterEvent.FilterJson,
                LastActionedUtc = createFilterEvent.ActionUTC
            };

            WriteEventToDb(createFilterEvent);

            var g = this.FilterRepo.GetFilter(createFilterEvent.FilterUID.ToString());

            g.Wait();
            Assert.IsNotNull(g.Result, "Unable to retrieve filter from filterRepo");
            Assert.AreEqual(filter, g.Result, "retrieved filter is incorrect");

            var f = this.FilterRepo.GetFiltersForProject(createFilterEvent.ProjectUID.ToString());

            f.Wait();
            Assert.IsNotNull(f.Result, "Unable to retrieve filters from filterRepo");
            Assert.AreEqual(0, f.Result.Count(), "retrieved filter count is incorrect");

            f = this.FilterRepo.GetFiltersForProjectUser(createFilterEvent.CustomerUID.ToString(), createFilterEvent.ProjectUID.ToString(), createFilterEvent.UserID);
            f.Wait();
            Assert.IsNotNull(f.Result, "Unable to retrieve user filters from filterRepo");
            Assert.AreEqual(0, f.Result.Count(), "retrieved user filter count is incorrect");
        }
Esempio n. 10
0
        public void GetFiltersForProject_PersistentOnly()
        {
            var custUid = new Guid("f57e30d2-ad64-452a-8d6c-0afd790eab6c");

            DateTime firstCreatedUtc             = new DateTime(2017, 1, 1, 2, 30, 3);
            var      createTransientFilterEvent1 = new CreateFilterEvent
            {
                CustomerUID = custUid,
                ProjectUID  = TestUtility.UIDs.MOCK_WEB_API_DIMENSIONS_PROJECT_UID,
                UserID      = TestUtility.UIDs.JWT_USER_ID,
                FilterUID   = Guid.NewGuid(),
                Name        = string.Empty,
                FilterType  = FilterType.Transient,
                FilterJson  = "blah1",
                ActionUTC   = firstCreatedUtc
            };
            var createTransientFilterEvent2 = new CreateFilterEvent
            {
                CustomerUID = custUid,
                ProjectUID  = TestUtility.UIDs.MOCK_WEB_API_DIMENSIONS_PROJECT_UID,
                UserID      = TestUtility.UIDs.JWT_USER_ID,
                FilterUID   = Guid.NewGuid(),
                Name        = "Transient 2",
                FilterType  = FilterType.Transient,
                FilterJson  = "blah2",
                ActionUTC   = firstCreatedUtc
            };

            var createPersistentFilterEvent1 = new CreateFilterEvent
            {
                CustomerUID = custUid,
                ProjectUID  = TestUtility.UIDs.MOCK_WEB_API_DIMENSIONS_PROJECT_UID,
                UserID      = TestUtility.UIDs.JWT_USER_ID,
                FilterUID   = new Guid("6396c4b0-3ed4-40fa-afed-035457252463"),
                Name        = "dateRangeType=Today with polygonLL",
                FilterType  = FilterType.Persistent,
                FilterJson  = "{\"startUtc\":null,\"endUtc\":null,\"dateRangeType\":0,\"designUID\":null,\"contributingMachines\":null,\"onMachineDesignID\":null,\"vibeStateOn\":null,\"polygonUID\":\"ca9c91c3-513b-4082-b2d7-0568899e56d5\",\"polygonName\":null,\"polygonLL\":[{\"Lat\":36.207118,\"Lon\":-115.01848},{\"Lat\":36.207334,\"Lon\":-115.018394},{\"Lat\":36.207492,\"Lon\":-115.019604},{\"Lat\":36.207101,\"Lon\":-115.019478}],\"forwardDirection\":null,\"layerNumber\":null}",
                ActionUTC   = firstCreatedUtc
            };

            var createPersistentFilterEvent2 = new CreateFilterEvent
            {
                CustomerUID = custUid,
                ProjectUID  = TestUtility.UIDs.MOCK_WEB_API_DIMENSIONS_PROJECT_UID,
                UserID      = TestUtility.UIDs.JWT_USER_ID,
                FilterUID   = new Guid("59e28218-0164-417b-8de0-9ed8f96d6ed2"),
                Name        = "dateRangeType=Yesterday with polygonLL",
                FilterType  = FilterType.Persistent,
                FilterJson  = "{\"startUtc\":null,\"endUtc\":null,\"dateRangeType\":1,\"designUID\":null,\"contributingMachines\":null,\"onMachineDesignID\":null,\"vibeStateOn\":null,\"polygonUID\":\"ca9c91c3-513b-4082-2d7-0568899e56d5\",\"polygonName\":null,\"polygonLL\":[{\"Lat\":36.207118,\"Lon\":-115.01848},{\"Lat\":36.207334,\"Lon\":-115.018394},{\"Lat\":36.207492,\"Lon\":-115.019604},{\"Lat\":36.207101,\"Lon\":-115.019478}],\"forwardDirection\":null,\"layerNumber\":null}",
                ActionUTC   = firstCreatedUtc
            };

            var createReportFilterEvent1 = new CreateFilterEvent
            {
                CustomerUID = custUid,
                ProjectUID  = TestUtility.UIDs.MOCK_WEB_API_DIMENSIONS_PROJECT_UID,
                UserID      = TestUtility.UIDs.JWT_USER_ID,
                FilterUID   = Guid.NewGuid(),
                Name        = "dateRangeType=Today with polygonLL",//match a peristent filter name on purpose
                FilterType  = FilterType.Report,
                FilterJson  = "{\"startUtc\":null,\"endUtc\":null,\"dateRangeType\":0,\"asAtDate\":\"false\",\"designUID\":null,\"contributingMachines\":null,\"onMachineDesignID\":null,\"vibeStateOn\":null,\"polygonUID\":\"ca9c91c3-513b-4082-b2d7-0568899e56d5\",\"polygonName\":null,\"polygonLL\":[{\"Lat\":36.207118,\"Lon\":-115.01848},{\"Lat\":36.207334,\"Lon\":-115.018394},{\"Lat\":36.207492,\"Lon\":-115.019604},{\"Lat\":36.207101,\"Lon\":-115.019478}],\"forwardDirection\":null,\"layerNumber\":null}",
                ActionUTC   = firstCreatedUtc
            };

            var createReportFilterEvent2 = new CreateFilterEvent
            {
                CustomerUID = custUid,
                ProjectUID  = TestUtility.UIDs.MOCK_WEB_API_DIMENSIONS_PROJECT_UID,
                UserID      = TestUtility.UIDs.JWT_USER_ID,
                FilterUID   = Guid.NewGuid(),
                Name        = "Report 2",
                FilterType  = FilterType.Report,
                FilterJson  = "{\"startUtc\":null,\"endUtc\":null,\"dateRangeType\":1,\"asAtDate\":\"true\",\"designUID\":null,\"contributingMachines\":null,\"onMachineDesignID\":null,\"vibeStateOn\":null,\"polygonUID\":\"ca9c91c3-513b-4082-2d7-0568899e56d5\",\"polygonName\":null,\"polygonLL\":[{\"Lat\":36.207118,\"Lon\":-115.01848},{\"Lat\":36.207334,\"Lon\":-115.018394},{\"Lat\":36.207492,\"Lon\":-115.019604},{\"Lat\":36.207101,\"Lon\":-115.019478}],\"forwardDirection\":null,\"layerNumber\":null}",
                ActionUTC   = firstCreatedUtc
            };

            this.FilterRepo.StoreEvent(createTransientFilterEvent1).Wait();
            this.FilterRepo.StoreEvent(createTransientFilterEvent2).Wait();
            this.FilterRepo.StoreEvent(createPersistentFilterEvent1).Wait();
            this.FilterRepo.StoreEvent(createPersistentFilterEvent2).Wait();
            this.FilterRepo.StoreEvent(createReportFilterEvent1).Wait();
            this.FilterRepo.StoreEvent(createReportFilterEvent2).Wait();

            var g = this.FilterRepo.GetFiltersForProject(TestUtility.UIDs.MOCK_WEB_API_DIMENSIONS_PROJECT_UID.ToString());

            g.Wait();
            Assert.IsNotNull(g.Result, "Unable to retrieve filters from filterRepo");
            Assert.IsTrue(g.Result.Count() > 1, "retrieved filter count is incorrect");

            g = this.FilterRepo.GetFiltersForProjectUser(custUid.ToString(), TestUtility.UIDs.MOCK_WEB_API_DIMENSIONS_PROJECT_UID.ToString(), TestUtility.UIDs.JWT_USER_ID);
            g.Wait();
            Assert.IsNotNull(g.Result, "Unable to retrieve filters from filterRepo");
            Assert.AreEqual(2, g.Result.Count(), "retrieved filter count is incorrect");

            var f = this.FilterRepo.GetFilter(createTransientFilterEvent1.FilterUID.ToString());

            f.Wait();
            Assert.IsNotNull(f.Result, "Unable to retrieve filter from filterRepo");
            Assert.AreEqual(createTransientFilterEvent1.FilterUID.ToString(), f.Result.FilterUid, "retrieved filter UId is incorrect");

            f = this.FilterRepo.GetFilter(createTransientFilterEvent2.FilterUID.ToString());
            f.Wait();
            Assert.IsNotNull(f.Result, "Unable to retrieve filter from filterRepo");
            Assert.AreEqual(createTransientFilterEvent2.FilterUID.ToString(), f.Result.FilterUid, "retrieved filter UId is incorrect");

            f = this.FilterRepo.GetFilter(createPersistentFilterEvent1.FilterUID.ToString());
            f.Wait();
            Assert.IsNotNull(f.Result, "Unable to retrieve filter from filterRepo");
            Assert.AreEqual(createPersistentFilterEvent1.FilterUID.ToString(), f.Result.FilterUid, "retrieved filter UId is incorrect");

            f = this.FilterRepo.GetFilter(createPersistentFilterEvent2.FilterUID.ToString());
            f.Wait();
            Assert.IsNotNull(f.Result, "Unable to retrieve filter from filterRepo");
            Assert.AreEqual(createPersistentFilterEvent2.FilterUID.ToString(), f.Result.FilterUid, "retrieved filter UId is incorrect");

            f = this.FilterRepo.GetFilter(createReportFilterEvent1.FilterUID.ToString());
            f.Wait();
            Assert.IsNotNull(f.Result, "Unable to retrieve filter from filterRepo");
            Assert.AreEqual(createReportFilterEvent1.FilterUID.ToString(), f.Result.FilterUid, "retrieved filter UId is incorrect");

            f = this.FilterRepo.GetFilter(createReportFilterEvent2.FilterUID.ToString());
            f.Wait();
            Assert.IsNotNull(f.Result, "Unable to retrieve filter from filterRepo");
            Assert.AreEqual(createReportFilterEvent2.FilterUID.ToString(), f.Result.FilterUid, "retrieved filter UId is incorrect");
        }