Inheritance: IProject
        public void respects_the_compile_target_flag()
        {
            var project = new Project { Name = "MyProject", CompileTarget = "debug" };
            project.Save("myproject.xml");

            ProjectLoader.Load("myproject.xml", "release", null).CompileTarget.ShouldEqual("release");
        }
        public IProject Load(string path)
        {
            var project = new Project
            {
                ProjectFolder = path,
                Name = Path.GetFileName(path)
            };

            var files = _fileSystem.FindFiles(path, FileSet.Shallow("*.config"));
            var candidates = files.Where(x => Path.GetFileName(x).EqualsIgnoreCase("App.config") || Path.GetFileName(x).EqualsIgnoreCase("Web.config"));
            if (candidates.Any())
            {
                project.ConfigurationFileName = candidates.First().ToFullPath();
            }
            else
            {
                var possibleFile = Path.GetFileName(path) + ".dll.config";
                candidates = _fileSystem.FindFiles(path, FileSet.Deep(possibleFile));
                if (candidates.Any())
                {
                    project.ConfigurationFileName = candidates.First().ToFullPath();
                }
            }

            // Auto-find the config file here.

            return project;
        }
        public void respects_the_profile_flag()
        {
            var project = new Project { Name = "MyProject", Profile = "Regular"};
            project.Save("myproject.xml");

            ProjectLoader.Load("myproject.xml", null, "Phantom").Profile.ShouldEqual("Phantom");
        }
Esempio n. 4
0
        public void find_all_workspaces_from_a_project()
        {
            hierarchy =
            DataMother.BuildHierarchy(
            @"
            s1/t4,Success
            s1/t5,Success
            s1/t6,Failure
            s1/s2/t7,Success
            s1/s2/t8,Failure
            s1/s2/s3/t9,Success
            s1/s2/s3/t10,Success
            s1/s2/s3/s4/t11,Success
            s5/t12,Failure
            s5/s6/t13,Success
            s5/s6/s7/t14,Success
            s5/s6/s7/s8/t15,Success
            s9/t16,Success
            s9/t17,Success
            s9/t18,Failure
            ");

            var project = new Project();
            hierarchy.FindAllWorkspaces(project).Select(x => x.Name).ShouldHaveTheSameElementsAs("s1", "s5", "s9");
        }
        public void copies_the_root_and_assembly_names()
        {
            var project = new Project
            {
                ProjectFolder = Path.Combine("src", "Foo"),
            };

            var assembly = new FixtureAssembly(project);
            assembly.RootFolder.ShouldEqual(project.GetTestFolder());
            assembly.AssemblyName.ShouldEqual("Foo");
        }
        public void SendAndAwait_Happy_Path()
        {
            var project = new Project
            {
                ProjectFolder = ".".ToFullPath().ParentDirectory().ParentDirectory(),
                TimeoutInSeconds = 240
            };

            using (var runner = new ProjectTestRunner(project))
            {
                runner.RunAndAssertTest("Subscriptions/Simple global subscriptions from one node to another");
            }
        }
        public NewProjectPresenter(IProjectController controller, IScreenConductor conductor, IProjectValidator validator,
            IProjectScreen view)
        {
            _controller = controller;
            _conductor = conductor;
            _validator = validator;
            _view = view;
            _project = new Project();

            _view.BindTo(_project);

            _save = new ActionCommand(save);
            _cancel = new ActionCommand(cancel);
        }
        public void SetUp()
        {
            project = new Project(@"c:\myfolder\myfile.xml")
            {

            };

            var service = new ProjectRunnerCodegenService(project);

            var hierarchy = DataMother.BuildHierarchy(@"
            ws1/suite1/test1 is good,Success
            ");

            theTest = hierarchy.FindTest("ws1/suite1/test1 is good");

            methodText = service.GenerateMethod(theTest);
        }
Esempio n. 9
0
        public void load_a_project_from_the_project_file_if_it_is_found()
        {
            var project = new Project
            {
                Name = "MyProject",
                Profile = "Regular",
                CompileTarget = "retail"
            };
            project.Save("myproject.xml");

            var input = new RunInput {Path = "myproject.xml"};

            var loader = new ProjectFileLoader(new FubuCore.FileSystem()).Load(input.Path);
            loader.Name.ShouldEqual("MyProject");
            loader.Profile.ShouldEqual("Regular");
            loader.CompileTarget.ShouldEqual("retail");
        }
Esempio n. 10
0
        public void delete_a_test_file()
        {
            var project = new Project
            {
                BinaryFolder = string.Empty,
                ProjectFolder = "",
                TestFolder = ""
            };
            var test = new Test("test to be saved");
            test.AddComment("some comment");
            test.FileName = "Test001.xml";

            project.Save(test);

            File.Exists("Test001.xml").ShouldBeTrue();
            project.DeleteFile(test);
            File.Exists("Test001.xml").ShouldBeFalse();
        }
Esempio n. 11
0
        public void get_test_path()
        {
            var project = new Project(@"c:\a\b\c\d\project.proj")
            {
                TestFolder = "tests"
            };
            Hierarchy hierarchy = DataMother.BuildHierarchy(@"
            t1,Success
            s1/t2,Success
            s1/s2/t3,Success
            ");

            Test test = hierarchy.FindTest("t1");

            project.GetTestPath(test).ShouldEqual(@"c:\a\b\c\d\tests\t1.xml");
            project.GetTestPath(hierarchy.FindTest("s1/t2")).ShouldEqual(@"c:\a\b\c\d\tests\s1\t2.xml");
            project.GetTestPath(hierarchy.FindTest("s1/s2/t3")).ShouldEqual(@"c:\a\b\c\d\tests\s1\s2\t3.xml");
        }
Esempio n. 12
0
        public void create_a_directory()
        {
            var project = new Project
            {
                BinaryFolder = string.Empty,
                ProjectFolder = "",
                TestFolder = ""
            };

            if (Directory.Exists("NewSuite")) Directory.Delete("NewSuite", true);
            var suite = new Suite("NewSuite");

            project.CreateDirectory(suite);

            Directory.Exists("NewSuite").ShouldBeTrue();

            var childSuite = new Suite("Child");
            suite.AddSuite(childSuite);

            project.CreateDirectory(childSuite);

            Directory.Exists("NewSuite\\Child").ShouldBeTrue();
        }
        public void pulls_the_current_filter_from_the_project()
        {
            var project = new Project
            {
                FixtureAssembly = typeof (GrammarMarker).Assembly.GetName().Name
            };

            project.WorkspaceFor("1").AddFilter(new FixtureFilter()
            {
                Name = "North", Type = FilterType.Fixture
            });

            project.WorkspaceFor("2").AddFilter(new FixtureFilter()
            {
                Name = "South",
                Type = FilterType.Fixture
            });

            project.SelectWorkspaces(new string[]{"1", "2"});

            var fa = new FixtureAssembly(project);

            fa.Filter.Filters.ShouldHaveTheSameElementsAs(project.CurrentFixtureFilter().Filters);
        }
Esempio n. 14
0
        public void SetUp()
        {
            var project = new Project
            {
                BinaryFolder = string.Empty,
                ProjectFolder = "",
                TestFolder = ""
            };
            test = new Test("Test001");
            test.AddComment("some comment");

            project.Save(test);

            project.RenameTest(test, "New Name");
        }
 public void SetUp()
 {
     project = DataMother.MathProject();
 }
Esempio n. 16
0
        public void get_test_path_when_the_test_overrides_the_file_name()
        {
            var project = new Project(@"c:\a\b\c\d\project.proj")
            {
                TestFolder = "tests"
            };
            Hierarchy hierarchy = DataMother.BuildHierarchy(@"
            t1,Success
            s1/t2,Success
            s1/s2/t3,Success
            ");

            Test test = hierarchy.FindTest("t1");
            test.FileName = "TheBigTest.xml";

            project.GetTestPath(test).ShouldEqual(@"c:\a\b\c\d\tests\TheBigTest.xml");
        }
Esempio n. 17
0
 public void GetBaseFolderReturnsEmptyStringIfNoFileNameIsSet()
 {
     var project = new Project();
     Assert.AreEqual(string.Empty, project.GetBaseProjectFolder());
 }
Esempio n. 18
0
 public void GetBaseFolder()
 {
     var project = new Project(@"c:\a\b\c\d\project.proj");
     Assert.AreEqual(@"c:\a\b\c\d", project.GetBaseProjectFolder());
 }
Esempio n. 19
0
 public void get_workspace_for_a_name_returns_the_same()
 {
     var project = new Project();
     project.WorkspaceFor("Main").ShouldBeTheSameAs(project.WorkspaceFor("Main"));
 }
 public void SetUp()
 {
     project = DataMother.MathProject();
     hierarchy = project.LoadTests();
 }
Esempio n. 21
0
 public void BindTo(Project project)
 {
     _binder.BindToModel(project);
 }
Esempio n. 22
0
        public void save_and_load_a_test()
        {
            var project = new Project
            {
                BinaryFolder = string.Empty,
                ProjectFolder = "",
                TestFolder = ""
            };
            var test = new Test("test to be saved");
            test.AddComment("some comment");
            test.FileName = "Test001.xml";

            project.Save(test);

            Test test2 = new TestReader().ReadFromFile(test.FileName);
            test2.Name.ShouldEqual(test.Name);
            test2.Parts.Count.ShouldEqual(1);

            test2.FileName.ShouldEqual("Test001.xml");
        }
Esempio n. 23
0
 public void get_the_test_path_of_a_test_at_the_hierarchy_scope()
 {
     var project = new Project(@"c:\a\b\c\d\project.proj")
     {
         TestFolder = "tests"
     };
     var hierarchy = new Hierarchy("something");
     var test = new Test("t0");
     hierarchy.AddTest(test);
     project.GetTestPath(test).ShouldEqual(@"c:\a\b\c\d\tests\t0.xml");
 }
Esempio n. 24
0
 public void default_test_folder()
 {
     var project = new Project();
     project.TestFolder.ShouldEqual("Tests");
 }
Esempio n. 25
0
 public void SetUp()
 {
     project = DataMother.MathProject();
     project.TimeoutInSeconds = 20;
     runner = project.LocalRunner();
 }
Esempio n. 26
0
        public void SetUp()
        {
            project = new Project();
            project.WorkspaceFor("States").AddFilter(new FixtureFilter()
            {
                Name = "StateFixtures",
                Type = FilterType.Namespace
            });

            project.WorkspaceFor("North").AddFilter(new FixtureFilter()
            {
                Name = "North",
                Type = FilterType.Fixture
            });

            project.WorkspaceFor("South").AddFilter(new FixtureFilter()
            {
                Name = "South",
                Type = FilterType.Fixture
            });
        }