Ejemplo n.º 1
0
   public void SearchString_Set_FiltersNodeByName()
   {
      NameFilter filter = new NameFilter();
      IMaxNode node = CreateNodeWithName("Test");

      filter.SearchString = "";
      Assert.IsTrue(filter.ShowNode(node));

      filter.SearchString = "T";
      Assert.IsTrue(filter.ShowNode(node));

      filter.SearchString = "Test";
      Assert.IsTrue(filter.ShowNode(node));

      filter.SearchString = "TestX";
      Assert.IsFalse(filter.ShowNode(node));

      filter.SearchString = "XTest";
      Assert.IsFalse(filter.ShowNode(node));
   }
Ejemplo n.º 2
0
   public void SearchString_UsingAsterisk_WorksAsWildcard()
   {
      NameFilter filter = new NameFilter();
      IMaxNode node = CreateNodeWithName("LoremIpsum");

      filter.SearchString = "ipsum";
      Assert.IsFalse(filter.ShowNode(node));

      filter.SearchString = "*ipsum";
      Assert.IsTrue(filter.ShowNode(node));

      filter.SearchString = "Lor*sum";
      Assert.IsTrue(filter.ShowNode(node));
   }
Ejemplo n.º 3
0
   public void CaseSensitive_SetFalse_MakesSearchCaseInsensitive()
   {
      NameFilter filter = new NameFilter();
      filter.CaseSensitive = false;

      IMaxNode node = CreateNodeWithName("Test");

      filter.SearchString = "Test";
      Assert.IsTrue(filter.ShowNode(node));

      filter.SearchString = "test";
      Assert.IsTrue(filter.ShowNode(node));
   }
Ejemplo n.º 4
0
   public void UseWildcard_SetTrue_ShowsNodesWithNameContainingSearchString()
   {
      NameFilter filter = new NameFilter();
      filter.UseWildcard = true;

      IMaxNode node = CreateNodeWithName("Test");

      filter.SearchString = "T";
      Assert.IsTrue(filter.ShowNode(node));

      filter.SearchString = "est";
      Assert.IsTrue(filter.ShowNode(node));

      filter.SearchString = "st";
      Assert.IsTrue(filter.ShowNode(node));

      filter.SearchString = "s";
      Assert.IsTrue(filter.ShowNode(node));
   }
Ejemplo n.º 5
0
   public void SearchString_UsingAsterisk_WorksCombinedWithUseWildcard()
   {
      NameFilter filter = new NameFilter();
      filter.UseWildcard = true;
      IMaxNode node = CreateNodeWithName("LoremIpsum");

      filter.SearchString = "rem*sum";
      Assert.IsTrue(filter.ShowNode(node));

      filter.SearchString = "*rem*sum";
      Assert.IsTrue(filter.ShowNode(node));
   }