public void Context()
        {
            _email = MockRepository.GenerateMock<Email>();

            const int emailId = 23;
            var emailRepository = MockRepository.GenerateStub<IRepository<Email>>();
            emailRepository.Stub(a => a.GetById(emailId)).Return(_email);

            _emailDto = new EmailDto
                                    {
                                        EmailId = emailId,
                                    };
            var command = new UpdateEmailVariablesCommand
                              {
                                  Email = _emailDto,
                              };
            var handler = new UpdateEmailVariablesCommandHandler(emailRepository);
            handler.Execute(command);
        }
Exemple #2
0
        public void Context()
        {
            _email = A.Fake <Email>();

            const int emailId         = 23;
            var       emailRepository = A.Fake <IRepository <Email> >();

            A.CallTo(() => emailRepository.GetAsync(emailId)).Returns(_email);

            _emailDto = new EmailDto
            {
                EmailId = emailId,
            };
            var command = new UpdateEmailVariablesCommand
            {
                Email = _emailDto,
            };
            var handler = new UpdateEmailVariablesCommandHandler(emailRepository);

            handler.ExecuteAsync(command).Wait();
        }