示例#1
0
        public void GetFlexiFigureBlockNumber_IfThereIsNoStoredNumberReturnsOneAndStoresTwo(BlockProcessor dummyBlockProcessor)
        {
            // Arrange
            FlexiFigureBlockFactory testSubject = CreateFlexiFigureBlockFactory();

            // Act
            int result = testSubject.GetFlexiFigureBlockNumber(dummyBlockProcessor);

            // Assert
            Assert.Equal(1, result);
            object newStoredNumber = dummyBlockProcessor.Document.GetData(FlexiFigureBlockFactory.NEXT_FLEXI_FIGURE_BLOCK_NUMBER_KEY);

            Assert.Equal(2, newStoredNumber);
        }
示例#2
0
        public void GetFlexiFigureBlockNumber_IfThereIsAStoredNumberReturnsItAndIncrementsStoredNumberByOne()
        {
            // Arrange
            const int      dummyStoredNumber   = 6;
            BlockProcessor dummyBlockProcessor = MarkdigTypesFactory.CreateBlockProcessor();

            dummyBlockProcessor.Document.SetData(FlexiFigureBlockFactory.NEXT_FLEXI_FIGURE_BLOCK_NUMBER_KEY, dummyStoredNumber);
            FlexiFigureBlockFactory testSubject = CreateFlexiFigureBlockFactory();

            // Act
            int result = testSubject.GetFlexiFigureBlockNumber(dummyBlockProcessor);

            // Assert
            Assert.Equal(dummyStoredNumber, result);
            object newStoredNumber = dummyBlockProcessor.Document.GetData(FlexiFigureBlockFactory.NEXT_FLEXI_FIGURE_BLOCK_NUMBER_KEY);

            Assert.Equal(dummyStoredNumber + 1, newStoredNumber); // Incremented by 1
        }