Live runtime verification

C# tests in this browser

A .NET 10 AppBundle is loading the same seven parameterless MSTest methods—including Behavioral coverage—used by the native core lane. The runtime identifier is browser-wasm.

C# · .NET WebAssembly

Starting the .NET runtime…

Page checks run first. The adapter then imports the generated runtime, executes the compiled MSTest assembly once, and validates its summary.

0/?

Checks running in this page

    Same seven C# test methods, one browser host.

    This compiled inventory contains seven methods. The adapter requires a zero exit code, a readable nonempty MSTest summary, and every discovered method to succeed. It also checks this page's visible heading and canonical target. Result rows appear here and in DevTools.

    .NET and adapter console

    Waiting for .NET console output…

    Copy-ready example

    A basic C# suite inside MSTest

    Keep the test method public and parameterless when it must run through both native MSTest and the stable browser reflection host.

    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using VanillaTest;
    
    [TestClass]
    public sealed class BasicTests
    {
        [TestMethod]
        public void LifecyclePasses()
        {
            var test = new VanillaTestSuite();
    
            test.Expects("2 + 2 equals 4");
            if (2 + 2 == 4) test.Pass(); else test.Fail();
            test.Done();
    
            test.Expects("uppercase preserves the word");
            if ("csharp".ToUpperInvariant() == "CSHARP") test.Pass(); else test.Fail();
            test.Done();
    
            TestResult result = test.Report();
            Assert.IsTrue(result.Ok, result.Report);
            Assert.AreEqual(2, result.Total);
        }
    }
    dotnet test --configuration Release
    dotnet vanilla-test --browser --project BasicTests.csproj
    This is not MTP in the browser.

    Stable MSTest 4.3.3 does not provide the Microsoft.Testing.Platform browser execution path needed here. The generated .NET 10 host discovers public parameterless [TestMethod] methods with reflection, honors the supported lifecycle attributes, and prints a deterministic summary. Use native MSTest for data rows, injected runner context, filtering, and full adapter behavior.

    Deployment boundary

    The browser result is a multi-file AppBundle.

    This page is deployed beside browser.js and the generated _framework/ tree. Keep the full output directory together. Copying only this HTML file cannot load .NET or the compiled test assembly.