BitzOrcas.Unit.Tests covers domain logic, value objects, and application-level validation rules — all tests that run without infrastructure dependencies.
Test scope
| Area | Example |
|---|---|
| Value objects | EmailAddress validation, NoteTitle constraints |
Result<T> | Success/failure creation, error matching |
| Domain events | Event construction and properties |
| IRequestRule | CreateGreetingCommandRule validation |
| Aggregates | Note creation, state transitions |
| Clock | FixedClock deterministic time tests |
Example: Result<T> test
[Fact]public void CreateNote_WithEmptyTitle_ShouldReturnValidationError(){ // Arrange var service = new NoteService();
// Act var result = service.CreateNote("", "content");
// Assert result.IsFailure.ShouldBeTrue(); result.Error.Type.ShouldBe(ErrorType.Validation); result.Error.Code.ShouldBe("Note.Title");}Example: IRequestRule test
[Fact]public void CreateGreetingCommandRule_ValidName_ShouldPass(){ var rule = new CreateGreetingCommandRule(); var cmd = new CreateGreetingCommand("Hello");
var errors = rule.Validate(cmd); errors.ShouldBeEmpty();}Running
dotnet test tests/BitzOrcas.Unit.Tests