NBug.Helpers.EmailDestinationBuilder.SendAttachments C# (CSharp) Method

SendAttachments() public method

public SendAttachments ( ) : EmailDestinationBuilder
return EmailDestinationBuilder
        public EmailDestinationBuilder SendAttachments()
        {
            _sendAttachments = true;

              return this;
        }

Usage Example

        public void BuildAttachmentsAndShortServerOptions_PreparesCorrectDestination()
        {
            // Arrange
              var fromAddress = new MailAddress("*****@*****.**");
              var toAddress = new MailAddress("*****@*****.**");
              var anotherAddress = new MailAddress("*****@*****.**");

              // Act
              var builder = new EmailDestinationBuilder(fromAddress, new[] { toAddress, anotherAddress }, ServerName);
              var credential = new NetworkCredential("test", "foo");

              string result = builder.SendAttachments().UseServer(false, credential).Build();

              // Assert
              var expected =
            string.Format(
              "Type=Mail;From={0};To={1},{2};UseAttachment={3};SmtpServer={4};UseSsl=false;Port=25;UseAuthentication=true;Username={5};Password={6};",
              fromAddress.Address,
              toAddress.Address,
              anotherAddress.Address,
              "true",
              ServerName,
              "test",
              "foo");

              Assert.Equal(expected, result);
        }
All Usage Examples Of NBug.Helpers.EmailDestinationBuilder::SendAttachments