コード例 #1
0
        public void RunSingleTestTest()
        {
            var tests = new TestPanelViewModel();

            Assert.False(tests.RunAllTestsCommand.CanExecute(null));
            var notified = false;

            tests.PropertyChanged += (sender, e) => notified = true;
            tests.Open("../../../Files/SimpleTests.xml");
            tests.Executor = executor;
            Assert.True(tests.Tests.Any(test => test.Result == ResultEnum.NotRunned));
            Assert.True(tests.RunAllTestsCommand.CanExecute(null));
            tests.Tests.FirstOrDefault(test => test.TestString == "1").ExecuteCommand.Execute(null);
            Assert.True(tests.NumberOfPassedTests == 1 && tests.NumberOfFailedTests == 0 && tests.NumberOfNotRunnedTests == 2);
            Assert.True(notified);
        }
コード例 #2
0
        public void SerializationTest()
        {
            var tests = new TestPanelViewModel();

            tests.AddTestCommand.Execute(null);
            var test       = tests.Tests.FirstOrDefault();
            var testString = "12345";

            test.TestString = testString;
            var path = "../../../Files/tests.xml";

            tests.Save(path);
            tests.Tests.Clear();
            tests.Open(path);
            Assert.AreEqual(1, tests.Tests.Count);
            Assert.AreEqual(testString, tests.Tests.FirstOrDefault().TestString);
        }