public void SetUpFixture()
        {
            RubyMSBuildEngineHelper.InitMSBuildEngine();

            List <ProjectBindingDescriptor> bindings = new List <ProjectBindingDescriptor>();

            using (TextReader reader = RubyBindingAddInFile.ReadAddInFile()) {
                AddIn addin = AddIn.Load(reader, String.Empty);
                bindings.Add(new ProjectBindingDescriptor(AddInHelper.GetCodon(addin, "/SharpDevelop/Workbench/ProjectBindings", "Ruby")));
            }
            ProjectBindingService.SetBindings(bindings);

            convertProjectCommand           = new DerivedConvertProjectToRubyProjectCommand();
            parseInfo                       = new ParseInformation(new DefaultCompilationUnit(new DefaultProjectContent()));
            convertProjectCommand.ParseInfo = parseInfo;
            convertProjectCommand.FileServiceDefaultEncoding = Encoding.Unicode;

            sourceProject           = new MockProject();
            sourceProject.Directory = @"d:\projects\test";
            source        = new FileProjectItem(sourceProject, ItemType.Compile, @"src\Program.cs");
            targetProject = (RubyProject)convertProjectCommand.CallCreateProject(@"d:\projects\test\converted", sourceProject);
            target        = new FileProjectItem(targetProject, source.ItemType, source.Include);
            source.CopyMetadataTo(target);

            textFileSource = new FileProjectItem(sourceProject, ItemType.None, @"src\readme.txt");
            textFileTarget = new FileProjectItem(targetProject, textFileSource.ItemType, textFileSource.Include);
            textFileSource.CopyMetadataTo(textFileTarget);

            convertProjectCommand.AddParseableFileContent(source.FileName, sourceCode);

            convertProjectCommand.CallConvertFile(source, target);
            convertProjectCommand.CallConvertFile(textFileSource, textFileTarget);
        }
        public void CanParseRubyProject()
        {
            ProjectCreateInformation createInfo = new ProjectCreateInformation();

            createInfo.Solution = new Solution();
            createInfo.OutputProjectFileName = @"C:\projects\test.rbproj";
            RubyProject project = new RubyProject(createInfo);

            Assert.IsTrue(parser.CanParse(project));
        }
Beispiel #3
0
        public void SetUpFixture()
        {
            info                       = new ProjectCreateInformation();
            info.Solution              = new Solution(new MockProjectChangeWatcher());
            info.ProjectName           = "Test";
            info.OutputProjectFileName = @"C:\Projects\Test\Test.rbproj";
            info.RootNamespace         = "Test";

            project = new RubyProject(info);
        }
        public void SetUpFixture()
        {
            projectBinding = new RubyProjectBinding();
            ProjectCreateInformation createInfo = new ProjectCreateInformation();

            createInfo.ProjectName           = "Ruby";
            createInfo.OutputProjectFileName = @"C:\Projects\Ruby.rbproj";
            createInfo.Solution = new Solution(new MockProjectChangeWatcher());
            project             = projectBinding.CreateProject(createInfo) as RubyProject;
        }
        public void SetUpFixture()
        {
            languageBinding = new RubyLanguageBinding();
            ProjectCreateInformation createInfo = new ProjectCreateInformation();

            createInfo.ProjectName           = "Ruby";
            createInfo.OutputProjectFileName = @"C:\Projects\Ruby.rbproj";
            createInfo.Solution = new Solution();
            project             = languageBinding.CreateProject(createInfo) as RubyProject;
        }
Beispiel #6
0
        public void IsTestProjectWhenPassedRubyPythonProjectReturnsTrue()
        {
            ProjectCreateInformation createInfo = new ProjectCreateInformation();

            createInfo.Solution = new Solution(new MockProjectChangeWatcher());
            createInfo.OutputProjectFileName = @"C:\projects\test.rbproj";
            RubyProject project = new RubyProject(createInfo);

            Assert.IsTrue(testFramework.IsTestProject(project));
        }
Beispiel #7
0
        public void IsTestProjectWhenPassedNullRubyProjectReturnsFalse()
        {
            RubyProject project = null;

            Assert.IsFalse(testFramework.IsTestProject(project));
        }