def test_n_interactions_2_seed_1(self):
        def C(i: int, rng: CobaRandom):
            return [1, 2][i]

        def A(i: int, c: int, rng: CobaRandom):
            return [[1, 2, 3], [4, 5, 6]][i]

        def R(i: int, c: int, a: int, rng: CobaRandom):
            return a - c

        simulation = LambdaSimulation(2, C, A, R, seed=1)
        interactions = list(simulation.read())

        self.assertEqual(len(interactions), 2)

        self.assertEqual(1, interactions[0].context)
        self.assertEqual([1, 2, 3], interactions[0].actions)
        self.assertEqual([0, 1, 2], interactions[0].kwargs["rewards"])

        self.assertEqual(2, interactions[1].context)
        self.assertEqual([4, 5, 6], interactions[1].actions)
        self.assertEqual([2, 3, 4], interactions[1].kwargs["rewards"])
    def test_n_interactions_none_seed_none(self):
        def C(i: int):
            return [1, 2][i]

        def A(i: int, c: int):
            return [[1, 2, 3], [4, 5, 6]][i]

        def R(i: int, c: int, a: int):
            return a - c

        simulation = LambdaSimulation(None, C, A, R)
        interactions = iter(simulation.read())

        interaction = next(interactions)

        self.assertEqual(1, interaction.context)
        self.assertEqual([1, 2, 3], interaction.actions)
        self.assertEqual([0, 1, 2], interaction.kwargs["rewards"])

        interaction = next(interactions)

        self.assertEqual(2, interaction.context)
        self.assertEqual([4, 5, 6], interaction.actions)
        self.assertEqual([2, 3, 4], interaction.kwargs["rewards"])