public void CannotSubmitASession_WhenSessionSubmissionIsClosed()
        {
            var controller = new SessionControllerBuilder().Build();

            var result = controller.Create(new Session());

            Assert.That(result, Is.InstanceOf<HttpUnauthorizedResult>());
        }
        public void ShouldEmailTheUserTheirSubmission_WhenCreating()
        {
            var postman = Substitute.For<IPostman>();
            var bob = new UserProfile { Name = "Bob", EmailAddress = "*****@*****.**", UserName = "******" };
            var session = new Session
            {
                Title = "Bob's awesome session",
                Abstract = "This is going to be awesome!"
            };

            var controller = new SessionControllerBuilder()
                .WithPostman(postman)
                .WhenSubmissionsAreOpen()
                .ForUser(bob)
                .Submitting(session)
                .Build();

            controller.Create(session);

            var expectedMailMessage = MailMessage.FromTemplate(SessionCreatedMailTemplate.Create(session), bob);
            postman.Received().Deliver(expectedMailMessage);
        }