Ejemplo n.º 1
0
        public async void ShoulbeNotCreateRequestIsNull()
        {
            AddMovieHandle handler  = new AddMovieHandle(_mediator.Object, _repositoryMovie);
            var            response = await handler.Handle(null, new System.Threading.CancellationToken());

            response.Notifications.Should().ContainSingle(e => e.Message == Resource.RequestNotbeNull);
        }
Ejemplo n.º 2
0
        public async void ShoulbeCreate()
        {
            AddMovieHandle handler  = new AddMovieHandle(_mediator.Object, _repositoryMovie);
            var            response = await handler.Handle(_command, new System.Threading.CancellationToken());

            response.Success.Should().BeTrue();
        }
Ejemplo n.º 3
0
        public async void ShouldBeNotCreateWithDuration(string duration)
        {
            _command.Duration = duration;
            AddMovieHandle handler  = new AddMovieHandle(_mediator.Object, _repositoryMovie);
            var            response = await handler.Handle(_command, new System.Threading.CancellationToken());

            response.Notifications.Should().ContainSingle(e => e.Message == Resource.DurationIsInvalid);
        }
Ejemplo n.º 4
0
        public async void ShouldBeNotCreateWithImage(string image)
        {
            _command.Image = image;
            AddMovieHandle handler  = new AddMovieHandle(_mediator.Object, _repositoryMovie);
            var            response = await handler.Handle(_command, new System.Threading.CancellationToken());

            response.Notifications.Should().ContainSingle(e => e.Message == Resource.ImageIsRequired);
        }
Ejemplo n.º 5
0
        public async void ShouldBeExistsTitle()
        {
            var repositoryMovie = MovieRepositoryBuilder.Instance().Exists().Build();

            AddMovieHandle handler  = new AddMovieHandle(_mediator.Object, repositoryMovie);
            var            response = await handler.Handle(_command, new System.Threading.CancellationToken());

            response.Notifications.Should().ContainSingle(e => e.Message == Resource.TitleExists);
        }