예제 #1
0
    public async Task WaitForCalendarYearBeforeUpgradingPreferredStatusToGold()
    {
        var customerId = Guid.NewGuid();

        var flightPlanWasAdded = new FlightPlanWasAdded
        {
            CustomerId = customerId,
            MilesFlown = 25000
        };
        var customerWasBilled = new CustomerWasBilled
        {
            CustomerId  = customerId,
            DollarsPaid = 3000
        };
        await saga.Handle(flightPlanWasAdded, context);

        await saga.Handle(customerWasBilled, context);

        // also test how long the timeout was supposed to be.
        await Verifier.Verify(
            new
        {
            context,
            saga.Data
        });
    }
    public async Task ShouldMakeCustomersPreferredStatusToGold()
    {
        var customerId         = Guid.NewGuid();
        var flightPlanWasAdded = new FlightPlanWasAdded
        {
            CustomerId = customerId,
            MilesFlown = 25000
        };
        var customerWasBilled = new CustomerWasBilled
        {
            CustomerId  = customerId,
            DollarsPaid = 3000
        };
        await saga.Handle(flightPlanWasAdded, context);

        await saga.Handle(customerWasBilled, context);

        await Verifier.Verify(
            new
        {
            context,
            saga.Data
        });
    }