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); }
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); }
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)); }
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>(); }
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); }
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); }
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); }
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); }