Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 5
0
 private void HandleSearch(SearchMessage search)
 {
     Movies = MovieRepository.Search(search.Keywords, search.Genre, search.Rating);
 }
Exemplo n.º 6
0
        public void Search()
        {
            var search = new SearchMessage(_Keywords);

            MessageBus.Publish<SearchMessage>(search);
        }