public void RunTestCommand_Will_Execute_Passing_Test() { TestMethodViewModel viewModel = new TestMethodViewModel(AddResultControl, ClearResultControl); MockTestManager testManager = new MockTestManager(); testManager.PassTests = true; viewModel.TestManager = testManager; TestFixture fixture = new TestFixture(); TestMethod testMethod = new TestMethod(); testMethod.Name = "test1"; fixture.Tests = new List<TestMethod>(); fixture.Tests.Add(testMethod); viewModel.Tests = new List<TestFixture>(); viewModel.Tests.Add(fixture); viewModel.RunTestsCommand.Execute(null); Thread.Sleep(5000); Confirm.Equal(1, viewModel.TestsPassed); Confirm.Equal(0,viewModel.TestsFailed); }
public static TestMethodViewModel CreateTestMethodViewModel(CloseApp closeApp, AddResultControl addResultContol, ClearResultControl clearTestResult) { TestMethodViewModel viewModel = new TestMethodViewModel(addResultContol, clearTestResult); viewModel.CloseApp = closeApp; viewModel.ConsoleMode = App.ConsoleMode; return viewModel; }
public void TestResultViewModels_Will_Return_TestResultViewModels_Based_On_Test_Results_Test() { TestMethodViewModel vm = new TestMethodViewModel(AddResultControl, ClearResultControl); vm.TestResults = new List<TestResult>(); TestResult r1 = new TestResult(); r1.Passed = true; r1.TestName = "Test1"; vm.TestResults.Add(r1); r1 = new TestResult(); r1.Passed = true; r1.TestName = "Test2"; vm.TestResults.Add(r1); Confirm.Equal(2, vm.TestResultViewModels.Count); Confirm.Equal("Test1", vm.TestResultViewModels[0].TestResult.TestName); Confirm.Equal("Test2", vm.TestResultViewModels[1].TestResult.TestName); }
private void TestBody() { TestMethodViewModel viewModel = new TestMethodViewModel(AddResultControl,ClearResultControl); viewModel.Tests = new List<TestFixture>(); Confirm.Equal(0, viewModel.Tests.Count); ComboBoxItem item = new ComboBoxItem(); item.Name = "UnitTests"; viewModel.SelectedItem = item; Confirm.Different(0, viewModel.Tests.Count); }