Ejemplo n.º 1
0
        public async Task ShouldBe_NotRequested_WhenNewMovie()
        {
            var list = new MovieRequests
            {
                TheMovieDbId = 123,
                Approved     = true
            };

            MovieMock.Setup(x => x.GetRequestAsync(123)).ReturnsAsync(list);
            var search = new SearchMovieViewModel
            {
                Id = 999,
            };
            var result = await Rule.Execute(search);

            Assert.True(result.Success);
            Assert.False(search.Approved);
            Assert.False(search.Requested);
        }
Ejemplo n.º 2
0
        public async Task ShouldBe_Requested_WhenExisitngMovie()
        {
            var list = new MovieRequests
            {
                TheMovieDbId = 123,
                Approved     = true,
                RequestType  = RequestType.Movie
            };

            MovieMock.Setup(x => x.GetRequestAsync(123)).ReturnsAsync(list);
            var search = new SearchMovieViewModel
            {
                Id = 123,
            };
            var result = await Rule.Execute(search);

            Assert.That(result.Success, Is.True);
            Assert.That(search.Approved, Is.True);
            Assert.That(search.Requested, Is.True);
        }