Skip to content

Commit 5c3a7fa

Browse files
author
Haik
committed
mocked fake service
1 parent 90f0c9a commit 5c3a7fa

30 files changed

+498
-9
lines changed

Communicator.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Communicator", "src\Communi
44
EndProject
55
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Communicator.Tests", "src\Communicator.Tests\Communicator.Tests.csproj", "{0305E58F-1C47-454C-B10B-A223F2561A85}"
66
EndProject
7+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Communicator.Demo", "src\Communicator.Demo\Communicator.Demo.csproj", "{5AF7F69F-4713-423A-964F-797D37E1C5B4}"
8+
EndProject
79
Global
810
GlobalSection(SolutionConfigurationPlatforms) = preSolution
911
Debug|Any CPU = Debug|Any CPU
@@ -18,5 +20,9 @@ Global
1820
{0305E58F-1C47-454C-B10B-A223F2561A85}.Debug|Any CPU.Build.0 = Debug|Any CPU
1921
{0305E58F-1C47-454C-B10B-A223F2561A85}.Release|Any CPU.ActiveCfg = Release|Any CPU
2022
{0305E58F-1C47-454C-B10B-A223F2561A85}.Release|Any CPU.Build.0 = Release|Any CPU
23+
{5AF7F69F-4713-423A-964F-797D37E1C5B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
24+
{5AF7F69F-4713-423A-964F-797D37E1C5B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
25+
{5AF7F69F-4713-423A-964F-797D37E1C5B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
26+
{5AF7F69F-4713-423A-964F-797D37E1C5B4}.Release|Any CPU.Build.0 = Release|Any CPU
2127
EndGlobalSection
2228
EndGlobal

Communicator.sln.DotSettings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:Boolean x:Key="/Default/UserDictionary/Words/=Dexatel/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Pandatech.Communicator
22

3-
43
## Introduction
54

5+
This nuget is fake for now. Under development.
66

77

88
## Features
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<InvariantGlobalization>true</InvariantGlobalization>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.1"/>
12+
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<ProjectReference Include="..\Communicator\Communicator.csproj" />
17+
</ItemGroup>
18+
19+
</Project>

src/Communicator.Demo/Program.cs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using Communicator.Extensions;
2+
using Communicator.Models;
3+
using Communicator.Services.Interfaces;
4+
5+
var builder = WebApplication.CreateBuilder(args);
6+
7+
builder.RegisterPandaCommunicator();
8+
9+
builder.Services.AddEndpointsApiExplorer();
10+
builder.Services.AddSwaggerGen();
11+
12+
var app = builder.Build();
13+
14+
app.UseSwagger();
15+
app.UseSwaggerUI();
16+
17+
app.MapGet("/send", async (IEmailService emailService, ISmsService smsService) =>
18+
{
19+
var email = new EmailMessage
20+
{
21+
Recipients = ["[email protected]"],
22+
Subject = "Some subject",
23+
Body = "Some body",
24+
IsBodyHtml = false,
25+
Channel = "GeneralSender"
26+
};
27+
await emailService.SendAsync(email);
28+
29+
var sms = new SmsMessage
30+
{
31+
Recipients = ["+37493910593"],
32+
Message = "Barev erjankutyun",
33+
Channel = "GeneralSender"
34+
};
35+
await smsService.SendAsync(sms);
36+
return Results.Ok("Email and SMS sent successfully.");
37+
});
38+
39+
app.Run();
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "http://json.schemastore.org/launchsettings.json",
3+
"profiles": {
4+
"http": {
5+
"commandName": "Project",
6+
"dotnetRunMessages": true,
7+
"launchBrowser": true,
8+
"launchUrl": "swagger",
9+
"applicationUrl": "http://localhost:80",
10+
"environmentVariables": {
11+
"ASPNETCORE_ENVIRONMENT": "Development"
12+
}
13+
},
14+
"https": {
15+
"commandName": "Project",
16+
"dotnetRunMessages": true,
17+
"launchBrowser": true,
18+
"launchUrl": "swagger",
19+
"applicationUrl": "https://443",
20+
"environmentVariables": {
21+
"ASPNETCORE_ENVIRONMENT": "Development"
22+
}
23+
}
24+
}
25+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
},
8+
"PandaCommunicator": {
9+
"SmsFake": false,
10+
"SmsConfiguration": {
11+
"ApiKey": "123"
12+
},
13+
"EmailFake": true,
14+
"EmailConfiguration": {
15+
"GeneralSender": {
16+
"SmtpServer": "smtp.gmail.com",
17+
"SmtpPort": "587",
18+
"SmtpUsername": "vazgen",
19+
"SmtpPassword": "vazgen123",
20+
"SenderEmail": "[email protected]",
21+
"UseSsl": "true",
22+
"TimeoutMs": "10000"
23+
},
24+
"TransactionalSender": {
25+
"SmtpServer": "smtp.gmail.com",
26+
"SmtpPort": "587",
27+
"SmtpUsername": "vazgen",
28+
"SmtpPassword": "vazgen123",
29+
"SenderEmail": "[email protected]",
30+
"UseSsl": "true",
31+
"TimeoutMs": "10000"
32+
}
33+
}
34+
}
35+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
},
8+
"AllowedHosts": "*"
9+
}

src/Communicator.Tests/Communicator.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
1414
<PackageReference Include="xunit" Version="2.6.6" />
1515
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
1616
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

src/Communicator/Class1.cs

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)