コード例 #1
0
        public void WorkCorrectly()
        {
            var stack  = new ObservableStack <int>();
            var helper = new TestHandler();

            helper.Initialize(stack);
            stack.Push(1);
            stack.Push(2);
            stack.Pop();
            Assert.AreEqual("+1+2-2", helper.GetLog());
        }
コード例 #2
0
        public void Log_ShouldContainAllOperations()
        {
            var stack  = new ObservableStack <int>();
            var helper = new StackOperationsLogger();

            helper.SubscribeOn(stack);
            stack.Push(1);
            stack.Push(2);
            stack.Pop();
            stack.Push(10);
            Assert.AreEqual("+1+2-2+10", helper.GetLog());
        }