Exemplo n.º 1
0
    public async Task ActivatorNotNecessary()
    {
        // Arrange
        var message    = new Message(Guid.NewGuid());
        var hypothesis = Hypothesis.For <Message>()
                         .Any(m => m == message);

        using var activator = new BuiltinHandlerActivator()
                              .Register(hypothesis.AsHandler);

        var network         = new InMemNetwork();
        var subscriberStore = new InMemorySubscriberStore();

        using var subscriber = await Subscriber(activator, network, subscriberStore);

        using var publisher = Publisher(network, subscriberStore);

        // Act
        await publisher.Publish(message);

        // Assert
        await hypothesis.Validate(TimeSpan.FromSeconds(5));
    }
Exemplo n.º 2
0
 public IHypothesis <object> AssertThat()
 {
     _hypothesis = Hypothesis.For <object>();
     return(_hypothesis);
 }