Ejemplo n.º 1
0
        private void GenerateEmails()
        {
            // Look for all types derived from EmailTest.

            var assembly = Assembly.GetExecutingAssembly();

            foreach (var type in assembly.GetTypes())
            {
                if (type.IsSubclassOf(typeof(EmailTests)) && !type.IsAbstract)
                {
                    var emailTest = Activator.CreateInstance(type) as EmailTests;
                    if (emailTest != null)
                    {
                        emailTest.EmailTestsInitialize();
                        var templateEmail = emailTest.GeneratePreview(null);
                        if (templateEmail != null)
                        {
                            try
                            {
                                _emailsCommand.TrySend(templateEmail);
                                var mockEmail = _emailServer.AssertEmailSent();
                                Add(null, templateEmail, mockEmail);
                            }
                            catch (Exception ex)
                            {
                                throw new ApplicationException("Cannot send a '" + type.FullName + "' templateEmail.", ex);
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void TestSubmitWithProfile()
        {
            var member = CreateMember();

            AddResume(member.Id);

            // Submit.

            var employer = CreateEmployer();
            var jobAd    = CreateJobAd(employer);

            _internalApplicationsCommand.SubmitApplication(member, jobAd, null);

            // Check the email.

            var email = _emailServer.AssertEmailSent();

            email.AssertAttachment(member.FullName + ".doc", "application/msword");
        }