public void CanExecuteIsTrueByDefault()
        {
            var viewModel = new LoadTestViewModel();

            var command = new RunLoadTestCommand(viewModel);

            Assert.IsTrue(command.CanExecute(null));
        }
Beispiel #2
0
        public LoadTestViewModel()
        {
            Configuration = new LoadTestConfiguration();

            RunLoadTestCommand = new RunLoadTestCommand(this);

            Heartbeats = new List <Heartbeat>();

            ChartModel = new LoadTestChart(Heartbeats);

            Defaults();
        }
Beispiel #3
0
        public LoadTestViewModel()
        {
            Configuration = new LoadTestConfiguration();

            RunLoadTestCommand = new RunLoadTestCommand(this);

            Heartbeats = new List<Heartbeat>();

            ChartModel = new LoadTestChart(Heartbeats);

            Defaults();
        }
        public void ShouldUpdateViewModel()
        {
            var viewModel = new LoadTestViewModel
            {
                SelectedTestType = typeof(InMemoryTest100),
                Configuration = new LoadTestConfiguration
                {
                    NumberOfThreads = 1,
                    Duration = TimeSpan.FromSeconds(1)
                }
            };

            var runLoadTestCommand = new RunLoadTestCommand(viewModel);

            runLoadTestCommand.Execute(null);

            WaitForLoadTestResult(viewModel);

            Assert.IsNotNull(viewModel.Heartbeat);
            Assert.IsNotNull(viewModel.Heartbeats);
            Assert.IsTrue(viewModel.Heartbeats.Any());
        }
        public void ThrowIfViewModelIsNull()
        {
            var runLoadTestCommand = new RunLoadTestCommand(null);

            Assert.IsNull(runLoadTestCommand);
        }