[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/SymmetryLabs/cpp.react/master/tests/src/EventStreamTest.h [Back]  [Original]

//          Copyright Sebastian Jeckel 2014.
// Distributed under the Boost Software License, Version 1.0.
//    (See accompanying file LICENSE_1_0.txt or copy at
//          http://www.boost.org/LICENSE_1_0.txt)

#pragma once

#include 
#include 

#include "gtest/gtest.h"

#include "react/Domain.h"
#include "react/Event.h"

///////////////////////////////////////////////////////////////////////////////////////////////////
namespace {

using namespace react;

///////////////////////////////////////////////////////////////////////////////////////////////////
/// EventStreamTest fixture
///////////////////////////////////////////////////////////////////////////////////////////////////
template 
class EventStreamTest : public testing::Test
{
public:
    template 
    class MyEngine : public TParams::template EngineT {};

    REACTIVE_DOMAIN(MyDomain, TParams::mode, MyEngine)
};

TYPED_TEST_CASE_P(EventStreamTest);

///////////////////////////////////////////////////////////////////////////////////////////////////
/// EventSources test
///////////////////////////////////////////////////////////////////////////////////////////////////
TYPED_TEST_P(EventStreamTest, EventSources)
{
    using D = typename EventSources::MyDomain;

    auto es1 = MakeEventSource();
    auto es2 = MakeEventSource();

    std::queue results1;
    std::queue results2;

    Observe(es1, [&] (int v)
    {
        results1.push(v);
    });

    Observe(es2, [&] (int v)
    {
        results2.push(v);
    });

    es1 

Web Proxy Viewer  |  New URL  |  Original Page