Пример #1
0
        public void CreateWithKeywords()
        {
            var keywords = Guid.NewGuid().ToString();

            var message = new SearchMessage(keywords);

            Assert.AreEqual(keywords, message.Keywords);
            Assert.IsNull(message.Genre);
            Assert.IsNull(message.Rating);
        }
Пример #2
0
        public void Create()
        {
            var keywords = Guid.NewGuid().ToString();
            var genre = Genres.Action;
            var rating = Ratings.G;

            var message = new SearchMessage(keywords, genre, rating);

            Assert.AreEqual(keywords, message.Keywords);
            Assert.AreEqual(genre, message.Genre);
            Assert.AreEqual(rating, message.Rating);
        }
Пример #3
0
        public void Search()
        {
            CreateContainer(false);
            _MessageBus = new MessageBus();
            ComponentContainer.Container.Kernel.AddComponentInstance<IMessageBus>(_MessageBus);

            var keywords = Guid.NewGuid().ToString();
            var genre = Genres.Action;
            var rating = Ratings.G;
            var searchMessage = new SearchMessage(keywords, genre, rating);

            var viewModel = new MasterViewModel();

            _MessageBus.Publish<SearchMessage>(searchMessage);

            _MovieRepository.AssertWasCalled(repo => repo.Search(
                Arg<String>.Is.Equal(keywords),
                Arg<Genres>.Is.Equal(genre),
                Arg<Ratings>.Is.Equal(rating)));
        }
        public void Search()
        {
            var message = new SearchMessage(Keywords, SelectedGenre, SelectedRating);

            MessageBus.Publish<SearchMessage>(message);
        }
Пример #5
0
 private void HandleSearch(SearchMessage search)
 {
     Movies = MovieRepository.Search(search.Keywords, search.Genre, search.Rating);
 }
Пример #6
0
        public void Search()
        {
            var search = new SearchMessage(_Keywords);

            MessageBus.Publish<SearchMessage>(search);
        }