public void SetUpFixture() { SD.InitializeForUnitTests(); WixBindingTestsHelper.InitMSBuildEngine(); // create the project. ProjectCreateInformation info = new ProjectCreateInformation(MockSolution.Create(), new FileName(@"C:\Projects\Test\Test.wixproj")); wixProject = new WixProjectWithOverriddenSave(info); // Add wix library item. wixLibraryItem = new WixLibraryProjectItem(wixProject); wixLibraryItem.Include = @"..\..\first.wixlib"; ProjectService.AddProjectItem(wixProject, wixLibraryItem); // Run Initialize on the WixLibraryFolderNode, which is // equivalent to expanding the node, so it adds it children. Cannot // call ExtTreeNode.Expanding since this relies on the tree node // being visible. WixLibraryFolderNodeTester nodeTester = new WixLibraryFolderNodeTester(wixProject); nodeTester.RunInitialize(); wixLibraryFolderNode = (WixLibraryFolderNode)nodeTester; wixLibraryNode = (WixLibraryNode)wixLibraryFolderNode.Nodes[0]; }
public void OpenCoverSettingsFileName() { MSBuildBasedProject project = new MSBuildBasedProject( new ProjectCreateInformation(MockSolution.Create(), new FileName(@"C:\temp\test.csproj"))); Assert.AreEqual(@"C:\temp\test.OpenCover.Settings", OpenCoverSettings.GetFileName(project)); }
private string GenerateOutput() { var solution = new MockSolution(Types.ToArray()); var generator = new CodeTraverser(solution.Object, this.Settings); var data = generator.GetAllInterfaces().ToList(); return OutputFormatter.GetOutput(data, this.Settings); }
public void SetUpFixture() { SD.InitializeForUnitTests(); wixNodeBuilder = new WixProjectNodeBuilder(); project = new MSBuildBasedProject( new ProjectCreateInformation(MockSolution.Create(), new FileName(@"C:\Projects\Test\test.csproj")) ); project.IdGuid = Guid.Parse("FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF"); }
public void SetUpFixture() { SD.InitializeForUnitTests(); WixBindingTestsHelper.InitMSBuildEngine(); info = new ProjectCreateInformation(MockSolution.Create(), new FileName(@"C:\Projects\Test\Test.wixproj")); info.RootNamespace = "Test"; project = new WixProject(info); }
public void NotMSBuildBasedProject() { ProjectLoadInformation info = new ProjectLoadInformation(MockSolution.Create(), FileName.Create(@"C:\Projects\Test.proj"), "Test"); MissingProject project = new MissingProject(info); ITestProject testProject = new NUnitTestProject(project); NUnitConsoleApplication app = new NUnitConsoleApplication(new[] { testProject }); Assert.AreEqual(project.GetType().BaseType, typeof(AbstractProject), "MissingProject should be derived from AbstractProject."); Assert.AreEqual(@"D:\SharpDevelop\bin\Tools\NUnit\nunit-console.exe", app.FileName); }
public void ShouldBuildInterfacesFromMarkedClassesOnly() { var solution = new MockSolution( typeof(LocalModel), // has the TypeScriptInterface attribute typeof(ModelFromDifferentProject), // has the TypeScriptInterface attribute typeof(string) // has no TypeScriptInterface attribute ); var codeTraverser = new CodeTraverser(solution.Object, new Settings()); Assert.AreEqual(2, codeTraverser.GetAllInterfaces().Count()); }
public override void MainSetup() { base.MainSetup(); var updatedSource = new MockSolution().InitializeWithTargetAndMixinInSameClass() .AllMockSourceFiles.First(f => f.ContainsPMixinAttribute) .Source; this.UpdateMockSourceFileSource( _MockSolution.Projects[0].MockSourceFiles[0], updatedSource); }
public override void MainSetup() { base.MainSetup(); var updatedSource = new MockSolution().InitializeWithNormalClassFile() .AllMockSourceFiles.First() .Source; this.UpdateMockSourceFileSource( _MockSolution.Projects[0].MockSourceFiles[0], updatedSource); }
public void ShouldHandleReservedPropNames() { var solution = new MockSolution(typeof(ReservedPropModel)); var codeTraverser = new CodeTraverser(solution.Object, new Settings()); var modules = codeTraverser.GetAllInterfaces(); var interfaces = modules.Single().Interfaces; var modelInterface = interfaces.Single(); var classProp = modelInterface.Members.SingleOrDefault(m => m.Name == "class"); var readonlyProp = modelInterface.Members.SingleOrDefault(m => m.Name == "readonly"); var publicProp = modelInterface.Members.SingleOrDefault(m => m.Name == "public"); Assert.AreEqual(3, modelInterface.Members.Count); Assert.IsNotNull(classProp); Assert.IsNotNull(readonlyProp); Assert.IsNotNull(publicProp); Assert.IsTrue(publicProp.Optional); }
void CreateSolutionCodeCoverageResults() { solution = MockSolution.Create(); fakeFileSystem = MockRepository.GenerateStub <IFileSystem>(); solutionCodeCoverageResults = new SolutionCodeCoverageResults(solution, fakeFileSystem); }
public MockCSharpProject() : this(MockSolution.Create(), "MyTests") { }
public TestProject(string languageName) : base(new ProjectCreateInformation(MockSolution.Create(), FileName.Create("c:\\temp\\TestProject.csproj"))) { this.languageName = languageName; }