Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Outline

MixEmul Test Suite

This directory contains the unit test projects for the MixEmul solution.

Test Projects

MixLib.Tests

Tests for the core MixLib library, including:

  • Type Tests (Type/)

    • MixByteTests.cs - Tests for the 6-bit MixByte type (constructors, operators, conversions)
    • FullWordTests.cs - Tests for 5-byte FullWord type (value operations, sign handling, cloning)
    • WordTests.cs - Tests for Word base class (static methods, slicing, magnitude operations)
    • FieldSpecTests.cs - Tests for field specifications (bounds validation, byte indexing)
    • ExtensionMethodsTests.cs - Tests for extension methods (sign operations, comparison values)
    • MixByteCollectionTests.cs - Tests for MixByte collections (loading, cloning, enumeration)
    • WordFieldTests.cs - Tests for word field operations (loading, applying, comparing)
    • IndexRegisterTests.cs - Tests for 2-byte index registers with padding
    • AddressRegisterTests.cs - Tests for 2-byte address registers
    • FullWordRegisterTests.cs - Tests for 5-byte registers
  • Core Component Tests

    • MemoryTests.cs - Tests for Memory class (indexing, bounds checking, storage)
    • RegistersTests.cs - Tests for Registers collection (initialization, indexing, addressing)
  • Instruction Tests (Instruction/)

    • InstructionHelpersTests.cs - Tests for instruction utility methods
  • Misc Tests (Misc/)

    • ValidationErrorTests.cs - Tests for validation error messages and formatting

Total: 325 tests

MixAssembler.Tests

Tests for the MixAssembler library, including:

  • Finding Tests (Finding/)

    • AssemblyFindingTests.cs - Tests for assembly errors and warnings (severity, location tracking, message formatting)
  • Value Tests (Value/)

    • NumberValueTests.cs - Tests for numeric literal parsing and value operations

Total: 46 tests

Running Tests

Run all tests in the solution:

dotnet test MixEmul.sln

Run tests for a specific project:

dotnet test tests\MixLib.Tests\MixLib.Tests.csproj
dotnet test tests\MixAssembler.Tests\MixAssembler.Tests.csproj

Run tests with detailed output:

dotnet test --verbosity detailed

Run tests with coverage:

dotnet test --collect:"XPlat Code Coverage"

Test Framework

  • xUnit 2.9.2 - Modern, extensible test framework
  • FluentAssertions 7.0.0 - Readable assertion library
  • Target Framework: .NET 10 (net10.0-windows7.0)

Test Philosophy

These tests are designed to:

  1. Validate intent, not just implementation - Tests verify proper behavior, which may help identify bugs in production code
  2. Follow best practices - Using modern patterns like Theory/InlineData for parameterized tests
  3. Be maintainable - Clear naming, logical organization, and comprehensive coverage of core functionality
  4. Be fast - Unit tests run in milliseconds, suitable for frequent execution during development

Coverage Focus

The current test suite focuses on:

  • Core type system (MixByte, Word, FullWord, FieldSpec)
  • Type conversions and operators
  • Validation and error reporting
  • Extension methods for type manipulation

Future test additions could cover:

  • Instruction execution
  • Device I/O operations
  • Memory and register operations
  • Assembly parsing
  • Mix computer simulation
Morty Proxy This is a proxified and sanitized view of the page, visit original site.