public void When_sending_a_rejection_email()
        {
            var email = S <IEmailService>();

            var organizer = new User("organizer")
            {
                Email = "*****@*****.**"
            };

            var callForSpeakers = new CallForSpeakers
            {
                Organizer = organizer,
                EventName = "event"
            };

            var speaker = new User("foo")
            {
                Email = "*****@*****.**"
            };

            var submission = new Submission(speaker, new SubmissionViewModel {
                Title = "title"
            }, callForSpeakers)
            {
                RejectionReason = "rejection reason"
            };

            var sender = new DomainEmailSender(email);

            sender.SubmissionRejection(submission);

            emailMessage = (EmailMessage)email.GetArgumentsForCallsMadeOn(x => x.Send(null))[0][0];
        }
        public void Should_map_from_entity()
        {
            var user = new User("foo");

            var entity = new CallForSpeakers
            {
                Description     = "description",
                EventName       = "event name",
                FirstDayOfEvent = new DateTime(2001, 1, 2),
                Id              = 123,
                LastDayOfEvent  = new DateTime(2001, 1, 3),
                LastDayToSubmit = new DateTime(2001, 1, 4),
                LogoUrl         = "logo url",
                Slug            = "asdasd",
                Organizer       = user
            };

            var input = new CallForSpeakersInput(entity);

            input.Description.ShouldEqual(entity.Description);
            input.EventName.ShouldEqual(entity.EventName);
            input.FirstDayOfEvent.ShouldEqual(entity.FirstDayOfEvent);
            input.Id.ShouldEqual(entity.Id);
            input.LastDayOfEvent.ShouldEqual(entity.LastDayOfEvent);
            input.LastDayToSubmit.ShouldEqual(entity.LastDayToSubmit);
            input.LogoUrl.ShouldEqual(entity.LogoUrl);
        }
 public CallForSpeakersInput(CallForSpeakers found)
 {
     EventName       = found.EventName;
     Description     = found.Description;
     FirstDayOfEvent = found.FirstDayOfEvent;
     LastDayOfEvent  = found.LastDayOfEvent;
     LastDayToSubmit = found.LastDayToSubmit;
     LogoUrl         = found.LogoUrl;
     Id = found.Id;
 }
Exemplo n.º 4
0
        public SubmissionViewModel(User speaker, CallForSpeakers callForSpeakers)
        {
            CallForSpeakers   = callForSpeakers;
            CallForSpeakersId = callForSpeakers.Id;

            SpeakerName     = speaker.Name;
            SpeakerEmail    = speaker.Email;
            SpeakerTwitter  = speaker.Twitter;
            SpeakerImageUrl = speaker.ImageUrl;
        }
Exemplo n.º 5
0
        public void Should_generate_unique_url_key()
        {
            var input = new CallForSpeakersInput
            {
                Description     = "description",
                EventName       = "event name",
                LastDayToSubmit = new DateTime(2001, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
                FirstDayOfEvent = new DateTime(2001, 2, 1, 0, 0, 0, 0, DateTimeKind.Utc),
                LastDayOfEvent  = new DateTime(2001, 3, 1, 0, 0, 0, 0, DateTimeKind.Utc),
                LogoUrl         = "logo url"
            };

            var call = new CallForSpeakers(input);

            call.Slug.ShouldEqual("event-name-2001-02-01");
        }
Exemplo n.º 6
0
        public void Should_truncate_large_key()
        {
            var input = new CallForSpeakersInput
            {
                Description     = "description",
                EventName       = "1234567890123456789012345678901234567890",
                LastDayToSubmit = new DateTime(2001, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
                FirstDayOfEvent = new DateTime(2001, 2, 1, 0, 0, 0, 0, DateTimeKind.Utc),
                LastDayOfEvent  = new DateTime(2001, 3, 1, 0, 0, 0, 0, DateTimeKind.Utc),
                LogoUrl         = "logo url"
            };

            var call = new CallForSpeakers(input);

            call.Slug.ShouldEqual("12345678901234567890123456-2001-02-01");
            call.Slug.Length.ShouldBeInRange(1, 40);
        }
Exemplo n.º 7
0
        public void When_initializing_data_entity_from_user_input()
        {
            var input = new CallForSpeakersInput
            {
                Description     = "description",
                EventName       = "event name",
                LastDayToSubmit = new DateTime(2001, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc),
                FirstDayOfEvent = new DateTime(2001, 2, 1, 0, 0, 0, 0, DateTimeKind.Utc),
                LastDayOfEvent  = new DateTime(2001, 3, 1, 0, 0, 0, 0, DateTimeKind.Utc),
                LogoUrl         = "logo url"
            };

            var model = new CallForSpeakers(input);

            model.Description.ShouldEqual(input.Description);
            model.EventName.ShouldEqual(input.EventName);
            model.LastDayToSubmit.ShouldEqual(input.LastDayToSubmit);
            model.FirstDayOfEvent.ShouldEqual(input.FirstDayOfEvent);
            model.LastDayOfEvent.ShouldEqual(input.LastDayOfEvent);
            model.LogoUrl.ShouldEqual(input.LogoUrl);
        }