예제 #1
0
        public void EmailClientAction_NoClientInstalled_ReturnsActionresultWithId101()
        {
            _emailClientFactory = MockRepository.GenerateStub <IEmailClientFactory>();
            _emailClientFactory.Stub(x => x.CreateEmailClient()).Return(null);
            var action = new EMailClientAction(_emailClientFactory, SignatureText);

            var result = action.ProcessJob(_job);

            Assert.AreEqual(11101, result[0]);
        }
예제 #2
0
        public void SetUp()
        {
            _tokenReplacer = new TokenReplacer();

            _profile = new ConversionProfile();
            _profile.EmailClient.Enabled      = true;
            _profile.EmailClient.Subject      = "testsubject";
            _profile.EmailClient.Content      = "This is content\r\nwith line breaks";
            _profile.EmailClient.AddSignature = false;
            _profile.EmailClient.Recipients   = "test@local";

            _job = MockRepository.GenerateStub <IJob>();
            _job.TokenReplacer = _tokenReplacer;
            _job.OutputFiles   = new[] { @"C:\Temp\file1.pdf" }.ToList();
            _job.Profile       = _profile;

            _mockMailClient = new MockMailClient();

            _emailClientFactory = MockRepository.GenerateStub <IEmailClientFactory>();
            _emailClientFactory.Stub(x => x.CreateEmailClient()).Return(_mockMailClient);
        }