Compare commits
2 commits
4b9b8d5e78
...
c645973b52
| Author | SHA1 | Date | |
|---|---|---|---|
|
c645973b52 |
|||
|
34c7b153ff |
2 changed files with 13 additions and 6 deletions
|
|
@ -115,6 +115,13 @@ Quelques règles non capturées par `.editorconfig` :
|
||||||
- Préférer les types BCL (`int`, `string`) aux types framework
|
- Préférer les types BCL (`int`, `string`) aux types framework
|
||||||
(`Int32`, `String`).
|
(`Int32`, `String`).
|
||||||
- Préférer les expressions de pattern matching aux casts explicites.
|
- Préférer les expressions de pattern matching aux casts explicites.
|
||||||
|
- **Pas de `object` dans le code source applicatif.** Types de retour,
|
||||||
|
paramètres, champs, propriétés, variables locales : tout doit être
|
||||||
|
typé statiquement. `dynamic` est interdit pour les mêmes raisons.
|
||||||
|
Un cast en `object` est presque toujours le symptôme d'un contrat
|
||||||
|
qu'on a laissé s'effriter (DTO, payload, handler) — refactore
|
||||||
|
le contrat (record typé, DTO dédié, méthode dédiée) au lieu de
|
||||||
|
shimer avec un cast.
|
||||||
|
|
||||||
## Branches & commits
|
## Branches & commits
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,11 @@ namespace Yavsc.Org.Tests
|
||||||
{
|
{
|
||||||
this.output = output;
|
this.output = output;
|
||||||
_serverFixture = serverFixture;
|
_serverFixture = serverFixture;
|
||||||
_logger = serverFixture.Logger;
|
_logger = serverFixture.Logger!;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void SendEMailSynchrone()
|
public async Task SendEMailSynchrone()
|
||||||
{
|
{
|
||||||
|
|
||||||
using IServiceScope scope = _serverFixture.Services.CreateScope();
|
using IServiceScope scope = _serverFixture.Services.CreateScope();
|
||||||
|
|
@ -32,12 +32,12 @@ namespace Yavsc.Org.Tests
|
||||||
scope.ServiceProvider.GetRequiredService<ISmtpClientFactory>());
|
scope.ServiceProvider.GetRequiredService<ISmtpClientFactory>());
|
||||||
|
|
||||||
output.WriteLine("SendEMailSynchrone ...");
|
output.WriteLine("SendEMailSynchrone ...");
|
||||||
mailSender.SendEmailAsync
|
await mailSender.SendEmailAsync
|
||||||
(
|
(
|
||||||
_serverFixture.SiteSettings.Owner.Name,
|
_serverFixture.SiteSettings!.Owner.Name,
|
||||||
_serverFixture.SiteSettings.Owner.EMail,
|
_serverFixture.SiteSettings!.Owner.EMail,
|
||||||
$"monthly email",
|
$"monthly email",
|
||||||
"test boby monthly email").Wait();
|
"test boby monthly email");
|
||||||
|
|
||||||
// Assert the SMTP roundtrip was short-circuited by the
|
// Assert the SMTP roundtrip was short-circuited by the
|
||||||
// recording fake installed in WebServerFixture: exactly
|
// recording fake installed in WebServerFixture: exactly
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue