/
dev-npgsql
/
npgsql
Обзор
Документация
Войти
/
dev-npgsql
/
npgsql
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
v7.0.7
test/Npgsql.NodaTime.Tests/NodaTimeSetupFixture.cs
18 строк
786 B
Shay Rojansky
Data source type mapper (#4691)
20 окт 2022, 15:22
Не верифицирован
20 окт 2022, 15:22
d1e7910
Код
Авторство
О чём код?
using NUnit.Framework; namespace Npgsql.NodaTime.Tests; // Note that we register NodaTime globally, rather than using the more standard data source mapping. // We can do this since NUnit runs each test assembly in a different process, so we get isolation and don't interfere with other, // non-NodaTime tests. This also allows us to test global type inference, which only works with global mappings. [SetUpFixture] public class NodaTimeSetupFixture { #pragma warning disable CS0618 // GlobalTypeMapper is obsolete [OneTimeSetUp] public void OneTimeSetUp() => NpgsqlConnection.GlobalTypeMapper.UseNodaTime(); [OneTimeTearDown] public void OneTimeTearDown() => NpgsqlConnection.GlobalTypeMapper.Reset(); #pragma warning restore CS0618 // GlobalTypeMapper is obsolete }