Пример #1
0
        public async void SendRecoveryEmailWithNull(string email, string userId, string token)
        {
            // Act
            SendgridService sendgridService = new SendgridService(_appSettings);

            var result = await sendgridService.SendRecoveryEmail(email, userId, token);

            // Assert
            Assert.False(result);
        }
Пример #2
0
        public async void SendContactEmailWithNull(string email, string message)
        {
            // Act
            SendgridService sendgridService = new SendgridService(_appSettings);

            var result = await sendgridService.SendContactEmail(email, message);

            // Assert
            Assert.False(result.Succeeded);
        }
Пример #3
0
 public CampaignAdapter
 (
     UpriseContext databaseContext,
     CampaignRepository campaignRepository,
     SendgridService sendgridService
 )
 {
     _databaseContext    = databaseContext ?? throw new ArgumentNullException(nameof(databaseContext));
     _campaignRepository = campaignRepository ?? throw new ArgumentNullException(nameof(campaignRepository));
     _sendGridService    = sendgridService ?? throw new ArgumentNullException(nameof(sendgridService));
 }
Пример #4
0
        public void Setup()
        {
            logger     = A.Fake <NullLogger <SendgridService> >();
            handler    = A.Fake <HttpMessageHandler>();
            httpClient = new HttpClient(handler);

            var config = new ConfigurationBuilder()
                         .AddJsonFile("appsettings.json")
                         .Build();

            sut   = new SendgridService(logger, config, httpClient);
            email = fixture.Create <Email>();
        }
Пример #5
0
        public async void SendRecoveryEmailWithWrongFormatEmail()
        {
            // Arrange
            var email = "email";

            // Act
            SendgridService sendgridService = new SendgridService(_appSettings);

            var result = await sendgridService.SendRecoveryEmail(email, "userId", "token");

            // Assert
            Assert.False(result);
        }
Пример #6
0
        public async void SendValidationEmailWithRightFormatEmail()
        {
            // Arrange
            var email = "*****@*****.**";

            // Act
            SendgridService sendgridService = new SendgridService(_appSettings);

            var result = await sendgridService.SendValidationEmail(email, "userId", "token", true);

            // Assert
            Assert.True(result);
        }
Пример #7
0
        public async void SendContactEmailWithRightFormatEmail()
        {
            // Arrange
            var email = "*****@*****.**";

            // Act
            SendgridService sendgridService = new SendgridService(_appSettings);

            var result = await sendgridService.SendContactEmail(email, "message");

            // Assert
            Assert.True(result.Succeeded);
        }
Пример #8
0
        public async void SendContactEmailWithWrongFormatEmail()
        {
            // Arrange
            var email = "email";

            // Act
            SendgridService sendgridService = new SendgridService(_appSettings);

            var result = await sendgridService.SendContactEmail(email, "userId");

            // Assert
            Assert.False(result.Succeeded);
        }