Пример #1
0
        public void write_two_levels_contexts()
        {
            const string firstLevelTestSuiteName  = "first level test suite";
            const string secondLevelTestSuiteName = "second level test suite";
            var          context = new Specification(firstLevelTestSuiteName);

            context.AddContext(new Specification(secondLevelTestSuiteName));

            _specificationWritter.Write(context);

            writter.Verify(x => x.WriteSuite(secondLevelTestSuiteName, 1));
        }
Пример #2
0
        public void write_total_number_of_test_in_different_levels_of_depths()
        {
            var context = new Specification("a suite test");

            context.AddTest(new global::Nala.Framework.Test("a test", () => { new Expected <string>(value: null).ToBeNull(); }));
            context.AddTest(new global::Nala.Framework.Test("anoter test", () => { new Expected <string>("f").ToBeNull(); }));

            var anotherContext = new Specification("another suite of tests");

            anotherContext.AddTest(new global::Nala.Framework.Test("another test", () => { new Expected <string>("null").ToBeNull(); }));
            context.AddContext(anotherContext);

            _specificationWritter.Write(context);

            writter.Verify(x => x.WriteNumberOfTest(1, 0, 2));
        }
Пример #3
0
        public static void Main(string[] args)
        {
            var path = args[0];

            var typeFinder           = new TypeFinder();
            var specificationFinder  = new SpecificationFinder(new ClassFinder(new MethodFinder()));
            var specificationWritter = new SpecificationWritter(new ConsoleWritter());

            var types         = typeFinder.find(path);
            var specification = new Specification(path);

            foreach (var type in types)
            {
                var currentSpecification = specificationFinder.Find(type);
                specification.AddContext(currentSpecification);
            }
            specificationWritter.Write(specification);
        }