Exemplo n.º 1
0
        public void Pass_Correct_Values_To_Server_Client()
        {
            // arrange
            var args          = new[] { "-n", "test" };
            var initMethod    = new InitMethod();
            var clientBuilder = new ServerClientBuilder();
            var dbg           = new DebugEngineProxyBuilder();
            var builder       = new TimeTravelFacadeBuilder(dbg);

            builder.WithGetStartingPosition(new Position(0, 0)).WithGetEndingPosition(new Position(1, 0));

            initMethod.TimeTravelFacade = builder.Build();
            initMethod.ServerClient     = clientBuilder.Build();
            initMethod.Settings         = new Settings
            {
                ServerUrl = "http://localhost:5000"
            };

            // act
            initMethod.Process(args);

            // assert
            clientBuilder.Mock.Verify(
                client => client.InitializeProject("test", new Position(0, 0), new Position(1, 0)), Times.Once);
        }
Exemplo n.º 2
0
        public void Identify_Correct_Starting_Position()
        {
            // Arrange
            var options = new IndexOptions
            {
                Start = new Position(0x35, 0x1)
            };

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

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

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

            // Act
            var startingPosition = indexMethod.GetStartingPosition(options);

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