Ejemplo n.º 1
0
        public void Ctor_EmptyRecipients_Exception(IReadOnlyCollection <string> recipients, IReadOnlyCollection <string> cc)
        {
            var email = new NoReplyEmailStub(
                recipients,
                cc,
                subject: "Awesome subject",
                viewPath: "viewPath",
                renderer: new ViewRendererFake());

            Assert.Throws <InvalidOperationException>(() => email.ThrowIfInvalid());
        }
Ejemplo n.º 2
0
        public void ThrowIfInvalid_InvalidViewPathAndSubject_Exception(string subject, string viewPath)
        {
            var t = new NoReplyEmailStub(
                recipients: new[] { ValidEmail },
                cc: null,
                subject: subject,
                viewPath: viewPath,
                renderer: new ViewRendererFake());

            Assert.Throws <ArgumentNullException>(() => t.ThrowIfInvalid());
        }