Client library reviewed.
All checks were successful
Pack and Push NuGet Package / publish (push) Successful in 43s

This commit is contained in:
2025-07-05 03:29:44 +02:00
parent 311b70cbb4
commit 904b244e76
13 changed files with 239 additions and 53 deletions

View File

@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\MessengerApi.Client\MessengerApi.Client.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,59 @@
using MessengerApi.Model;
using MessengerApi.Model.Messages;
namespace MessengerApi.Example
{
internal class Program
{
static void Main(string[] args)
{
var client1 = new Client(
new Credentials(
"aab8f7e9-ad13-4bf8-bb2e-0cd93d81adc0",
"http://localhost:5259"));
var client2 = new Client(
new Credentials(
"8f73f683-7cb3-40df-998e-6e604aef0e53",
"http://localhost:5259"));
var user1 = Guid.Parse("f696442b-e8dc-4074-b34f-94bcece8e74b");
var user2 = Guid.Parse("15d97720-f5b7-47aa-9c1a-71f98b0b9248");
var messageId = client1.SendMessage(new OutboxMessage
{
ToUserId = user2,
PayloadType = "TEST",
Payload = "TEST"
});
var state = client1.Verify(messageId);
if (state.IsDelivered != false)
{
throw new Exception();
}
var peeking = client2.Peek();
if (peeking != 1)
{
throw new Exception();
}
var receive = client2.GetMessages();
if (receive.Count() != 1)
{
throw new Exception();
}
state = client1.Verify(messageId);
if (state.IsDelivered != true)
{
throw new Exception();
}
}
}
}