Skip to content

Commit 875b397

Browse files
author
Igor Evdokimov
committed
- fix
1 parent f89c7e0 commit 875b397

File tree

7 files changed

+20
-19
lines changed

7 files changed

+20
-19
lines changed

Botticelli.AI.Test/AIProvider/ChatGptProviderTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void StartMockServer()
5757
]
5858
};
5959

60-
Server.Given(Request.Create().WithPath("/completions").UsingPost())
60+
Server?.Given(Request.Create().WithPath("/completions").UsingPost())
6161
.RespondWith(
6262
Response.Create()
6363
.WithStatusCode(200)

Botticelli.AI.Test/AIProvider/DeepSeekGptProviderTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void StartMockServer()
6262
]
6363
};
6464

65-
Server.Given(Request.Create().WithPath("/completions").UsingPost())
65+
Server?.Given(Request.Create().WithPath("/completions").UsingPost())
6666
.RespondWith(
6767
Response.Create()
6868
.WithStatusCode(200)

Botticelli.AI.Test/AIProvider/YaGptProviderTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public void StartMockServer()
3636
{
3737
Result = new Result
3838
{
39-
Alternatives = new List<Alternative>()
40-
{
39+
Alternatives =
40+
[
4141
new()
4242
{
4343
Message = new YaGpt.Message.YaGpt.Message
@@ -47,11 +47,11 @@ public void StartMockServer()
4747
},
4848
Status = "ALTERNATIVE_STATUS_TRUNCATED_FINAL"
4949
}
50-
}
50+
]
5151
}
5252
};
5353

54-
Server.Given(Request.Create().WithPath("/completion").UsingPost())
54+
Server?.Given(Request.Create().WithPath("/completion").UsingPost())
5555
.RespondWith(
5656
Response.Create()
5757
.WithStatusCode(200)

Tests/Botticelli.Framework.Vk.Tests/Botticelli.Framework.Vk.Tests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,8 @@
4242
<ProjectReference Include="..\Shared\Shared.csproj" />
4343
</ItemGroup>
4444

45+
<ItemGroup>
46+
<Folder Include="Settings\" />
47+
</ItemGroup>
48+
4549
</Project>

Tests/Botticelli.Framework.Vk.Tests/LongPollMessagesProviderTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using Botticelli.Framework.Vk.Messages;
22
using Botticelli.Framework.Vk.Messages.Options;
3-
using Botticelli.Framework.Vk.Tests.Settings;
43
using Botticelli.Shared.Utils;
54
using Microsoft.Extensions.Configuration;
65
using Shared;

Tests/Botticelli.Framework.Vk.Tests/Settings/SampleSettings.cs

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

Tests/MetricsRandomGenerator/MetricsSender.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,24 @@ public MetricsSender(IServiceProvider sp)
1919
}
2020

2121

22-
public async Task StartAsync(CancellationToken cancellationToken)
22+
public Task StartAsync(CancellationToken cancellationToken)
2323
{
2424
for (var i = 0; i < _threadsCount; i++)
2525
{
2626
var thread = new Thread(ThreadProc);
2727
thread.Start();
2828
}
29+
30+
return Task.CompletedTask;
2931
}
3032

3133

32-
public async Task StopAsync(CancellationToken cancellationToken) => _tokenSource.Cancel();
34+
public Task StopAsync(CancellationToken cancellationToken)
35+
{
36+
_tokenSource.Cancel();
37+
38+
return Task.CompletedTask;
39+
}
3340

3441
private void ThreadProc()
3542
{
@@ -53,7 +60,7 @@ private void ThreadProc()
5360
Console.WriteLine($"Publishing: {metric.BotId}, {metric.Name}, {metric.Timestamp}");
5461

5562
var task = _publisher.Publish(metric, token);
56-
task.Wait();
63+
task.Wait(token);
5764

5865
Thread.Sleep(500);
5966
}

0 commit comments

Comments
 (0)