Ejemplo n.º 1
0
        public void GetPostFilters_FiltersContainDisplayFolder_PostCommandFilterIsNotEmpty()
        {
            var filters = new CaptionFilter[]
            {
                new CaptionFilter(Target.Perspectives, "my perspective")
                , new CaptionFilter(Target.DisplayFolders, "my display-folder")
            };

            var builder = new SetDiscoveryCommandBuilder();
            builder.Build(filters);
            var postFilters = builder.GetPostFilters();

            Assert.That(postFilters, Is.Not.Null.And.Not.Empty);
        }
Ejemplo n.º 2
0
        public void GetCommandText_FiltersContainDisplayFolder_CommandFiltersDoesNotContainDoubleAnd()
        {
            var filters = new CaptionFilter[]
            {
                new CaptionFilter(Target.Perspectives, "my perspective")
                , new CaptionFilter(Target.DisplayFolders, "my display-folder")
            };

            var builder = new SetDiscoveryCommandBuilder();
            builder.Build(filters);
            var commandText = builder.GetCommandText();

            Assert.That(commandText.Replace(" ", "").ToLower(), Is.Not.StringContaining("andand"));
        }
Ejemplo n.º 3
0
        public void GetCommandText_FiltersContainDisplayFolder_DisplayFolderIsNotInCommandFilter()
        {
            var filters = new CaptionFilter[]
            {
                new CaptionFilter(Target.Perspectives, "my perspective")
                , new CaptionFilter(Target.DisplayFolders, "my display-folder")
            };

            var builder = new SetDiscoveryCommandBuilder();
            builder.Build(filters);
            var commandText = builder.GetCommandText().ToLower();
            var filtersText = commandText.Substring(commandText.IndexOf(" from "));

            Assert.That(filtersText, Is.Not.StringContaining("display").And.Not.StringContaining("folder"));
        }