using Bunit; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace AyCode.Blazor.Components.Tests; /// /// Base class for bUnit tests using MSTest. /// Provides BunitContext setup and teardown. /// public abstract class BunitTestContext : TestContextWrapper { [TestInitialize] public void Setup() => Context = new BunitContext(); [TestCleanup] public void TearDown() => Context?.Dispose(); } /// /// Wrapper for bUnit BunitContext to work with MSTest lifecycle. /// public abstract class TestContextWrapper { protected BunitContext? Context { get; set; } }