/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Testing/test/AssemblyFixtureTest.cs
50 строк
1 KB
Alexander Köplinger
Upgrade xunit version to 2.9.0 (#57303)
23 авг 2024, 20:27
Не верифицирован
23 авг 2024, 20:27
9209724
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Xunit; namespace Microsoft.AspNetCore.InternalTesting; #pragma warning disable xUnit1041 // Fixture arguments to test classes must have fixture sources // We include a collection and assembly fixture to verify that they both still work. [Collection("MyCollection")] [TestCaseOrderer("Microsoft.AspNetCore.InternalTesting.AlphabeticalOrderer", "Microsoft.AspNetCore.InternalTesting.Tests")] public class AssemblyFixtureTest { public AssemblyFixtureTest( TestAssemblyFixture assemblyFixture, TestCollectionFixture collectionFixture) { AssemblyFixture = assemblyFixture; CollectionFixture = collectionFixture; } public TestAssemblyFixture AssemblyFixture { get; } public TestCollectionFixture CollectionFixture { get; } [Fact] public void A() { Assert.NotNull(AssemblyFixture); Assert.Equal(0, AssemblyFixture.Count); Assert.NotNull(CollectionFixture); Assert.Equal(0, CollectionFixture.Count); AssemblyFixture.Count++; CollectionFixture.Count++; } [Fact] public void B() { Assert.Equal(1, AssemblyFixture.Count); Assert.Equal(1, CollectionFixture.Count); } } [CollectionDefinition("MyCollection", DisableParallelization = true)] public class MyCollection : ICollectionFixture<TestCollectionFixture> { }