예제 #1
0
        public void GetPrefixedFieldListShouldIncludeOnlyInResultApprovalColumns()
        {
            var stub = new SearchQueryGeneratorStub();
            var rootTable = new TableDefinition("test");
            stub.RootTable = rootTable;
            rootTable.AddField("Approval", ColumnTypes.Approval);

            Assert.IsTrue(stub.GetPrefixedFieldListPublic(0, true).Contains("[Approval]"));
            Assert.IsTrue(stub.GetPrefixedFieldListPublic(0, true).Contains("[ApprovalId]"));

            stub.ResultColumns.Add("None");
            stub.LimitResultColumns = true;

            Assert.IsFalse(stub.GetPrefixedFieldListPublic(0, true).Contains("[Approval]"));
            Assert.IsFalse(stub.GetPrefixedFieldListPublic(0, true).Contains("[ApprovalId]"));

            stub.ResultColumns.Add("ApprovalId");

            Assert.IsFalse(stub.GetPrefixedFieldListPublic(0, true).Contains("[Approval]"));
            Assert.IsTrue(stub.GetPrefixedFieldListPublic(0, true).Contains("[ApprovalId]"));

            stub.ResultColumns.Add("Approval");

            Assert.IsTrue(stub.GetPrefixedFieldListPublic(0, true).Contains("[Approval]"));
            Assert.IsTrue(stub.GetPrefixedFieldListPublic(0, true).Contains("[ApprovalId]"));
        }
예제 #2
0
        public void GetPrefixedFieldListShouldIncludeOnlyInResultReverseCrossRefColumns()
        {
            var stub = new SearchQueryGeneratorStub();
            var rootTable = new TableDefinition("test");
            stub.RootTable = rootTable;
            stub.ReverseCrossReferences.Add(new ReferenceFieldDefinition { ColumnType = ColumnTypes.ReverseReference, SystemName = "Ref", Name = "RefN", Alias = "RefA", DefinedIn = new ReferenceProcessDefinition() });

            Assert.IsTrue(stub.GetPrefixedFieldListPublic(0, false).Contains("[RefN]"));

            stub.ResultColumns.Add("None");
            stub.LimitResultColumns = true;

            Assert.IsFalse(stub.GetPrefixedFieldListPublic(0, false).Contains("[RefN]"));

            stub.ResultColumns.Clear();
            stub.ResultColumns.Add("RefN");

            Assert.IsTrue(stub.GetPrefixedFieldListPublic(0, false).Contains("[RefN]"));

            stub.ResultColumns.Clear();
            stub.ResultColumns.Add("Ref");

            Assert.IsTrue(stub.GetPrefixedFieldListPublic(0, false).Contains("[RefN]"));
        }
예제 #3
0
        public void GetPrefixedFieldListShouldIncludeOnlyInResultIntColumns()
        {
            var stub = new SearchQueryGeneratorStub();
            var rootTable = new TableDefinition("test");
            stub.RootTable = rootTable;
            rootTable.AddField("Int", ColumnTypes.Integer, isRichText: true);

            Assert.IsTrue(stub.GetPrefixedFieldListPublic(0, true).Contains("[Int]"));

            stub.ResultColumns.Add("None");
            stub.LimitResultColumns = true;

            Assert.IsFalse(stub.GetPrefixedFieldListPublic(0, true).Contains("[Int]"));

            stub.ResultColumns.Add("Int");

            Assert.IsTrue(stub.GetPrefixedFieldListPublic(0, true).Contains("[Int]"));
        }