public void It_should_not_display_a_message_nothing_was_found_by_default()
                {
                    FindReplaceWindowBase.CloseWindow();

                    var root = FindReplaceWindowBase
                               .ShowWindow <FindReplaceWindowStub>()
                               .rootVisualElement;
                    var result = root.GetElement <TextElement>("p-window__no-result");

                    Assert.IsTrue(result.ClassListContains("hide"));
                }
                public void It_should_clear_not_found_message_when_searching_again()
                {
                    Setup("", new IFindResult[0]);
                    FindReplaceWindowBase.CloseWindow();

                    var findResult = Substitute.For <IFindResult>();

                    findResult.Text.Returns("Lorem Ipsum");
                    var root = Setup("Lorem", new [] { findResult });

                    var result = root.GetElement <TextElement>("p-window__no-result");

                    Assert.IsTrue(result.ClassListContains("hide"));
                }
            private VisualElement Setup(string searchText, IFindResult[] result, bool matchCase = true)
            {
                FindReplaceWindowBase.CloseWindow();

                var window = FindReplaceWindowBase.ShowWindow <FindReplaceWindowStub>();

                window.searchText = searchText;
                window.result     = result;

                var root = window.rootVisualElement;

                var searchInput = root.GetElement <TextField>("p-window__input-find-text");

                searchInput.value = searchText;

                var elMatchCase = root.GetElement <Toggle>("p-window__match-case");

                elMatchCase.value = matchCase;

                root.ClickButton("p-window__search");

                return(root);
            }
 public void AfterEach()
 {
     FindReplaceWindowBase.CloseWindow();
 }