public void PingTest() { // Arrange var emailHelper = new YesmailService(); var stop = false; // Act while (stop) { try { var checkedStatus = emailHelper.CheckStatus( "https://services.yesmail.com/enterprise/status/0fb77aa1-7335-4101-847f-f18aa82a5866"); Thread.Sleep(45000); stop = true; } catch (Exception e) { } } }
public void _2_CheckStatusForEmailWithBadPayload_Should_Return_StatusCodeError() { // Arrange var emailHelper = new YesmailService(); // Act var checkedStatus = emailHelper.CheckStatus( @"https://services.yesmail.com/enterprise/status/0fb77aa1-7335-4101-847f-f18aa82a5866"); // Assert _logger.Info("\nCheckStatus.Status\n-------------\n" + checkedStatus.statusMessage); Assert.That(checkedStatus.statusCode, Is.EqualTo(StatusCode.ERROR), "StatusCode"); }
public void _4_CheckStatusForValidPayload_Should_Not_Return_Error() { // Arrange var emailService = new YesmailService(); var messageId = 1256210; var dto = DtoFactory.CreateEr1Message(RandomGenerator.RandomString(6)); // Act var initialStatus = emailService.SendEmail(dto, messageId); var checkStatus = emailService.CheckStatus(initialStatus.statusURI); // Assert _logger.Info("\nStatusMessage: " + checkStatus.statusMessage); _logger.Info("\nStatusNoWaitUrl\n-------------\n" + checkStatus.statusNoWaitURI); _logger.Info("\nStatusNoWaitUrl\n-------------\n" + checkStatus.statusCode); Assert.That(checkStatus.statusCode, Is.Not.EqualTo(StatusCode.ERROR), "StatusCode"); }