LogoLogo
  • Dosaic
  • Hosting
    • WebHost
    • Generator
    • Abstractions
  • Plugins
    • Authorization
      • Abstractions
      • Keycloak
    • Endpoints
      • Abstractions
      • RestResourceEntity
    • Handlers
      • Abstractions
      • CQRS
    • Jobs
      • Hangfire
    • Management
      • Unleash
    • Mapping
      • Mapster
    • Messaging
      • Abstractions
      • MassTransit
    • Persistence
      • Abstractions
      • EntityFramework
      • InMemory
      • MongoDb
      • S3
      • VaultSharp
    • Validations
      • Abstractions
      • Attribute
  • Extensions
    • RestEase
    • Sqids
  • Testing
    • NUnit
Powered by GitBook
On this page
  1. Testing

NUnit

This plugin is designed to have a "all-in-one"-package for testing, so you will basically have more packages on the Tests installed as needed, but can start using it without searching the packages.

How to unit test metric collection

using var metricsCollector = new TestMetricsCollector("my-metric-name");
metricsCollector.CollectedMetrics.Should().BeEmpty();

// do test stuff e.g. call method, etc..

metricsCollector.Instruments.Should().Contain("my-metric-name");
metricsCollector.CollectedMetrics.Should().ContainsMetric(1);
PreviousSqids

Last updated 3 months ago