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

            Assert.AreEqual(counter.Counter, 0);

            sut.SwapChannel(null);
            Assert.AreEqual(counter.Counter, 0);
        }
Exemplo n.º 2
0
        public IChatManager ChatBuilder(Deltin.CustomGameAutomation.Chat deltinChat)
        {
            IChatDeltinChannelSwapper deltinChannelSwapper = new ChatDeltinChannelSwapper(deltinChat);
            IChatChannelSwapper       chatChannelSwapper   = new ChatChannelSwapper(deltinChannelSwapper);

            IChatDecorator chatDecorator = new ChatDecorator();

            IChatDeltinPrinter deltinPrinter = new ChatDeltinPrinter(deltinChat);

            IChatManager chat = new ChatManager(chatChannelSwapper, chatDecorator, deltinPrinter);

            return(chat);
        }
Exemplo n.º 3
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.º 4
0
        public void TestWhenSwapChannelIfDifferentToSameChannelThenNoChange()
        {
            FakeChatDeltinChannelSwapperCounter counter = new FakeChatDeltinChannelSwapperCounter();;
            ChatChannelSwapper sut = new ChatChannelSwapper(counter);

            Assert.AreEqual(counter.Counter, 0);

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

            sut.SwapChannelIfDifferent(Channel.Group);
            Assert.AreEqual(counter.Counter, 1);
        }
Exemplo n.º 5
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);
        }