Exemplo n.º 1
0
        public void KanKanSendMessageSendsMessageToNextFrame(string messageOne, string messageTwo)
        {
            KarassFramesStub karass = new KarassFramesStub(
                new List <FrameRequest[]>
            {
                new[]
                {
                    _firstFrameRequest,
                    _secondFrameRequest
                }
            },
                _dependencies,
                _frameFactory);

            KanKanCore.KanKan kanKan = new KanKanCore.KanKan(karass, _frameFactory);

            kanKan.SendMessage(messageOne);
            kanKan.MoveNext();

            Assert.True(_firstFrameMessage == messageOne);

            kanKan.SendMessage(messageTwo);
            kanKan.MoveNext();
            Assert.True(_secondFrameMessage == messageTwo);
        }
Exemplo n.º 2
0
        public void GivenNoMoveNextFirstFrameReturnedOnReset()
        {
            KarassFramesStub karass = new KarassFramesStub(
                new List <FrameRequest[]> {
                new[]
                {
                    _mockFramesFactory.GetValidFrameRequest(FirstFrameSpy)
                }
            },
                _dependencies,
                _frameFactory
                );
            KanKan kanKan = new KanKan(karass, _frameFactory);

            kanKan.MoveNext();
            kanKan.Reset();
            kanKan.MoveNext();
            Assert.True(_timesFirstFrameRun == 2);
        }
Exemplo n.º 3
0
        public void MessagesOnlyLastForOneFrame(string message)
        {
            KarassFramesStub karass = new KarassFramesStub(
                new List <FrameRequest[]>
            {
                new[]
                {
                    _firstFrameRequest,
                    _secondFrameRequest
                }
            },
                _dependencies,
                _frameFactory);

            KanKanCore.KanKan kanKan = new KanKanCore.KanKan(karass, _frameFactory);

            kanKan.SendMessage(message);
            kanKan.MoveNext();
            Assert.True(_firstFrameMessage == message);

            kanKan.MoveNext();
            Assert.True(_secondFrameMessage == string.Empty);
        }