Пример #1
0
        public void Get_The_Correct_Ending_Position()
        {
            var indexMethod = new IndexMethod();

            indexMethod.TimeTravelFacade = new TimeTravelFacadeBuilder()
                                           .WithLastPosition(new Position(1, 1))
                                           .Build();
            indexMethod.GetEndingPosition(new IndexOptions()).Should().Be(new Position(1, 1));
            indexMethod.GetEndingPosition(new IndexOptions {
                End = new Position(2, 2)
            }).Should().Be(new Position(2, 2));
        }
Пример #2
0
        public void Identify_Correct_Ending_Position()
        {
            // Arrange
            var options = new IndexOptions
            {
                End = new Position(0x35, 0x1)
            };

            var dbg         = new DebugEngineProxyBuilder();
            var indexMethod = new IndexMethod();

            indexMethod.DebugEngineProxy = dbg.Build();
            var builder = new TimeTravelFacadeBuilder(dbg);

            builder.WithGetEndingPosition(new Position(0x35, 5));
            indexMethod.TimeTravelFacade = builder.Build();

            // Act
            var endingPosition = indexMethod.GetEndingPosition(options);

            // Assert
            endingPosition.Should().Be(new Position(0x35, 1),
                                       "35:1 means that the high portion is 35 and the low portion is 1");
        }