/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Testing/test/TestPlatformHelperTest.cs
54 строки
2 KB
William Godbe
Rename Microsoft.Aspnetcore.Testing to Microsoft.AspNetCore.InternalTesting (#51713)
02 ноя 2023, 03:15
Не верифицирован
02 ноя 2023, 03:15
fc8deca
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.AspNetCore.InternalTesting; using Xunit; namespace Microsoft.AspNetCore.InternalTesting; public class TestPlatformHelperTest { [ConditionalFact] [OSSkipCondition(OperatingSystems.MacOSX)] [OSSkipCondition(OperatingSystems.Windows)] public void IsLinux_TrueOnLinux() { Assert.True(TestPlatformHelper.IsLinux); Assert.False(TestPlatformHelper.IsMac); Assert.False(TestPlatformHelper.IsWindows); } [ConditionalFact] [OSSkipCondition(OperatingSystems.Linux)] [OSSkipCondition(OperatingSystems.Windows)] public void IsMac_TrueOnMac() { Assert.False(TestPlatformHelper.IsLinux); Assert.True(TestPlatformHelper.IsMac); Assert.False(TestPlatformHelper.IsWindows); } [ConditionalFact] [OSSkipCondition(OperatingSystems.Linux)] [OSSkipCondition(OperatingSystems.MacOSX)] public void IsWindows_TrueOnWindows() { Assert.False(TestPlatformHelper.IsLinux); Assert.False(TestPlatformHelper.IsMac); Assert.True(TestPlatformHelper.IsWindows); } [ConditionalFact] [FrameworkSkipCondition(RuntimeFrameworks.CLR | RuntimeFrameworks.CoreCLR | RuntimeFrameworks.None)] public void IsMono_TrueOnMono() { Assert.True(TestPlatformHelper.IsMono); } [ConditionalFact] [FrameworkSkipCondition(RuntimeFrameworks.Mono)] public void IsMono_FalseElsewhere() { Assert.False(TestPlatformHelper.IsMono); } }