1
/** \file search_input.h */ // -*-c++-*-
3
// Copyright (C) 2010 Daniel Burrows
5
// This program is free software; you can redistribute it and/or
6
// modify it under the terms of the GNU General Public License as
7
// published by the Free Software Foundation; either version 2 of the
8
// License, or (at your option) any later version.
10
// This program is distributed in the hope that it will be useful, but
11
// WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
// General Public License for more details.
15
// You should have received a copy of the GNU General Public License
16
// along with this program; see the file COPYING. If not, write to
17
// the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
// Boston, MA 02111-1307, USA.
20
#ifndef APTITUDE_GTK_VIEWS_MOCKS_SEARCH_INPUT_H
21
#define APTITUDE_GTK_VIEWS_MOCKS_SEARCH_INPUT_H
23
#include <gmock/gmock.h>
24
#include <gtk/views/search_input.h>
32
/** \brief Mock implementation of search_input for use in unit
35
* Provides signals which, by default, are connected by the
38
class search_input : public views::search_input
41
MOCK_METHOD0(get_search_text, Glib::ustring());
42
MOCK_METHOD1(set_search_text, void(const Glib::ustring &));
43
MOCK_METHOD1(set_error_message, void(const Glib::ustring &));
44
MOCK_METHOD1(set_input_validity, void(bool));
45
MOCK_METHOD1(set_find_sensitivity, void(bool));
46
MOCK_METHOD1(connect_search_text_changed, sigc::connection(const sigc::slot<void> &));
47
MOCK_METHOD1(connect_search, sigc::connection(const sigc::slot<void> &));
49
sigc::signal<void> signal_search_text_changed;
50
sigc::signal<void> signal;
55
using testing::Invoke;
57
ON_CALL(*this, connect_search_text_changed(_))
58
.WillByDefault(Invoke(&signal_search_text_changed,
59
&sigc::signal<void>::connect));
61
ON_CALL(*this, connect_search(_))
62
.WillByDefault(Invoke(&signal,
63
&sigc::signal<void>::connect));
70
#endif // APTITUDE_GTK_VIEWS_MOCKS_SEARCH_INPUT_H