Exemple #1
0
        public void ReadCaatSearchableDocuments_FilterOutBadPopTables()
        {
            //Arrange
            var workspaceId           = -343;
            var connectionFactoryMock = new Mock <IConnectionFactory>();
            var aRepo = new AnalyticsRepository(connectionFactoryMock.Object, null);

            //Act
            var caatPopTables             = new List <string>();
            var badPopTables              = new[] { "asdf", "Zca_POP_2", "Zca_POP_asdf_123" };
            var popTablesDontMatchIndexes = new[] { "Zca_POP_999_123", "Zca_POP_123_123" };

            caatPopTables.AddRange(badPopTables);
            caatPopTables.AddRange(popTablesDontMatchIndexes);
            var indexes = new List <Int32>()
            {
                1, 2
            };
            var result1 = aRepo.ReadCaatSearchableDocuments(workspaceId, caatPopTables, indexes);
            var result2 = aRepo.ReadCaatTrainingDocuments(workspaceId, caatPopTables, indexes);

            //Assert
            Assert.That(result1.Count, Is.EqualTo(0));
            Assert.That(result2.Count, Is.EqualTo(0));
        }
Exemple #2
0
        public void ReadCaatSearchableDocuments_NoCaatPopTables()
        {
            //Arrange
            var aRepo = new AnalyticsRepository(connectionFactory, null);

            //Act
            var caatPopTables = new List <string>();
            var indexes       = aRepo.ReadCaatIndexes(Config.WorkSpaceId);
            var result1       = aRepo.ReadCaatSearchableDocuments(Config.WorkSpaceId, caatPopTables, indexes);
            var result2       = aRepo.ReadCaatTrainingDocuments(Config.WorkSpaceId, caatPopTables, indexes);

            //Assert
            Assert.That(result1.Count, Is.EqualTo(0));
            Assert.That(result2.Count, Is.EqualTo(0));
        }
Exemple #3
0
        public void ReadCaatSearchableDocuments_NoCaatIndexesOrPopTables()
        {
            //Arrange
            var workspaceId           = -343;
            var connectionFactoryMock = new Mock <IConnectionFactory>();
            var aRepo = new AnalyticsRepository(connectionFactoryMock.Object, null);

            //Act
            var caatPopTables = new List <string>();
            var indexes       = new List <Int32>();
            var result1       = aRepo.ReadCaatSearchableDocuments(workspaceId, caatPopTables, indexes);
            var result2       = aRepo.ReadCaatTrainingDocuments(workspaceId, caatPopTables, indexes);

            //Assert
            Assert.That(result1.Count, Is.EqualTo(0));
            Assert.That(result2.Count, Is.EqualTo(0));
        }