Пример #1
0
        static void Main(string[] args)
        {
            if (args.Length > 0)
            {
                RunHelper.StartTimedTestRun(suite =>
                {
                    var loader = new TestLoader();

                    foreach (var arg in args)
                    {
                        Debug.WriteLine(arg);

                        if (Directory.Exists(arg))
                        {
                            suite.Add(loader.LoadFromDirectory(arg));
                        }
                        else if (File.Exists(arg))
                        {
                            suite.Add(loader.LoadFromFile(arg));
                        }
                    }
                });
            }
            else
            {
                Console.WriteLine("No arguments.");
            }
        }
Пример #2
0
        public void testLoadFromDirectoryRelative()
        {
            // Arrange
            TestSuite suite = null;
            TestLoader loader = new TestLoader();
            string directory = @"..\..\..\TestLoaderTestTests\bin\Debug\";

            // Act
            suite = loader.LoadFromDirectory(directory);

            // Assert
            Assert.AreEqual(1, suite.Tests.Count);
        }
Пример #3
0
        public void testLoadFromDirectoryAbsolute()
        {
            // Arrange
            TestSuite suite = null;
            TestLoader loader = new TestLoader();
            string directory = System.IO.Path.GetFullPath(@"..\..\..\TestLoaderTestTests\bin\Debug\");

            // Act
            suite = loader.LoadFromDirectory(directory);

            // Assert
            Assert.AreEqual(1, suite.Tests.Count);
        }
Пример #4
0
        public void testLoadFromDirectoryFail()
        {
            // Arrange
            TestSuite suite = null;
            TestLoader loader = new TestLoader();
            string directory = "x";

            try
            {
                // Act
                suite = loader.LoadFromDirectory(directory);

                Assert.Fail();
            }
            catch (ArgumentException actual)
            {
                // Assert
                Assert.AreEqual("Directory does not exist\r\nParameter name: directory", actual.Message);
            }
        }