Exemplo n.º 1
0
        public void TestSwapBackDoesNothingIfPreviousIsNull()
        {
            FakeChatDeltinChannelSwapperCounter counter = new FakeChatDeltinChannelSwapperCounter();;
            ChatChannelSwapper sut = new ChatChannelSwapper(counter);

            Assert.AreEqual(counter.Counter, 0);

            sut.SwapChannel(Channel.Group);
            Assert.AreEqual(counter.Counter, 1);

            sut.SwapBack();
            Assert.AreEqual(counter.Counter, 1);
        }
Exemplo n.º 2
0
        public void TestSwapBackReturnsToPreviousChannel()
        {
            FakeChatDeltinChannelSwapperCounter counter = new FakeChatDeltinChannelSwapperCounter();;
            ChatChannelSwapper sut = new ChatChannelSwapper(counter);

            Assert.AreEqual(counter.Counter, 0);

            sut.SwapChannel(Channel.Group);
            Assert.AreEqual(counter.Counter, 1);

            sut.SwapChannel(Channel.Match);
            Assert.AreEqual(counter.Counter, 2);

            sut.SwapBack();
            Assert.AreEqual(counter.Counter, 3);

            sut.SwapChannelIfDifferent(Channel.Group);
            Assert.AreEqual(counter.Counter, 3);
        }