Example #1
0
        public async void ShoulbeNotDeleteRequestIsNull()
        {
            DeleteSessionHandle handler = new DeleteSessionHandle(_mediator.Object, _repositorySession);
            var response = await handler.Handle(null, new System.Threading.CancellationToken());

            response.Notifications.Should().ContainSingle(e => e.Message == Resource.RequestNotbeNull);
        }
Example #2
0
        public async void ShoulBeNotDeleteSessionUnder10Days()
        {
            var repositorySession       = SessionRepositoryBuilder.Instance().Find(_id).Exists().Build();
            DeleteSessionHandle handler = new DeleteSessionHandle(_mediator.Object, repositorySession);
            var response = await handler.Handle(_command, new System.Threading.CancellationToken());

            response.Notifications.Should().ContainSingle(e => e.Message == Resource.SessionCanNotBeDeleteUnder10Days);
        }
Example #3
0
        public async void ShoulbeNotDeleteRequestNotFound()
        {
            var repositorySession       = SessionRepositoryBuilder.Instance().NotFound().Build();
            DeleteSessionHandle handler = new DeleteSessionHandle(_mediator.Object, repositorySession);
            var response = await handler.Handle(_command, new System.Threading.CancellationToken());

            response.Notifications.Should().ContainSingle(e => e.Message == Resource.SessionNotFound);
        }
Example #4
0
        public async void ShouldDeleteMovie()
        {
            var repositorySession       = SessionRepositoryBuilder.Instance().Find(_id).NotExists().Build();
            DeleteSessionHandle handler = new DeleteSessionHandle(_mediator.Object, repositorySession);
            var response = await handler.Handle(_command, new System.Threading.CancellationToken());

            response.Success.Should().BeTrue();
        }