-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* email test
- Loading branch information
Yaroslav Husynin
committed
Mar 24, 2020
1 parent
3d3d9bd
commit 64539a8
Showing
2 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using Elfo.Wardein.Abstractions.Configuration.Models; | ||
using Elfo.Wardein.Abstractions.Services; | ||
using Elfo.Wardein.Abstractions.Watchers; | ||
using Elfo.Wardein.Core.Helpers; | ||
using Elfo.Wardein.Integrations.Oracle.Integration; | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using System.Threading.Tasks; | ||
|
||
namespace Elfo.Wardein.Core.Tests | ||
{ | ||
[TestClass] | ||
public class GetEmailFromWatchers | ||
{ | ||
private string connectionString = string.Empty; | ||
OracleConnectionConfiguration OracleConnectionConfiguration; | ||
private OracleIntegration oracleIntegration; | ||
private IAmWatcherPersistenceService watcherPersistenceService; | ||
private IAmNotificationService notificationService; | ||
|
||
[TestInitialize] | ||
public void Initialize() | ||
{ | ||
var configuration = new ConfigurationBuilder() | ||
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) | ||
.Build(); | ||
|
||
connectionString = configuration["StorageConnectionString"]; | ||
WardeinBaseConfiguration wbc = new WardeinBaseConfiguration(); | ||
|
||
configuration.Bind(wbc); | ||
ServicesContainer.Initialize(wbc); | ||
|
||
OracleConnectionConfiguration = new OracleConnectionConfiguration.Builder(connectionString) | ||
.WithClientId(configuration["OracleAdditionalParams:ClientId"]) | ||
.WithClientInfo(configuration["OracleAdditionalParams:ClientInfo"]) | ||
.WithModuleName(configuration["OracleAdditionalParams:ModuleName"]) | ||
.WithDateLanguage(configuration["OracleAdditionalParams:DateLanguage"]) | ||
.Build(); | ||
oracleIntegration = new OracleIntegration(OracleConnectionConfiguration); | ||
watcherPersistenceService = ServicesContainer.WatcherPersistenceService(); | ||
notificationService = ServicesContainer.NotificationService(Abstractions.NotificationType.Mail); | ||
} | ||
|
||
[TestMethod] | ||
[TestCategory("ManualTest")] | ||
public async Task IsEmailWasSent() | ||
{ | ||
Task result = null; | ||
var svc = await watcherPersistenceService.UpsertCurrentStatus(1, 2, "SRVWEB07", false); | ||
if (svc.PreviousStatus == false) | ||
{ | ||
result = notificationService.SendNotificationAsync("[email protected];", "Restore was Successful test Message", | ||
$"Attention"); | ||
} | ||
|
||
Assert.IsNotNull(result); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters