ServiceReferencesProjectItem AddWCFMetadataProjectItemToProject() { var projectItem = new ServiceReferencesProjectItem(project); projectItem.Include = @"Service References\"; ProjectService.AddProjectItem(project, projectItem); return(projectItem); }
public void CreateDirectoryNode_WCFMetadataProjectItem_CreatesServiceReferencesFolderNode() { CreateProject(); ServiceReferencesProjectItem projectItem = AddWCFMetadataProjectItemToProject(); DirectoryNode node = DirectoryNodeFactory.CreateDirectoryNode(projectItem, FileNodeStatus.None); Assert.IsTrue(node is ServiceReferencesFolderNode); }
void AddServiceReferencesItemToProject() { if (IsServiceReferencesItemMissingFromProject()) { var projectItem = new ServiceReferencesProjectItem(project); projectItem.Include = "Service References"; AddProjectItemToProject(projectItem); } }
public void CreateDirectoryNode_WCFMetadataProjectItem_ProjectItemPassedToDirectoryNodeCreated() { CreateProject(); ServiceReferencesProjectItem expectedProjectItem = AddWCFMetadataProjectItemToProject(); DirectoryNode node = DirectoryNodeFactory.CreateDirectoryNode(expectedProjectItem, FileNodeStatus.None); ProjectItem projectItem = node.ProjectItem; Assert.AreEqual(expectedProjectItem, projectItem); }
public void CreateDirectoryNode_WCFMetadataProjectItem_FileNodeStatusPassedToDirectoryNodeCreated() { CreateProject(); ServiceReferencesProjectItem projectItem = AddWCFMetadataProjectItemToProject(); DirectoryNode node = DirectoryNodeFactory.CreateDirectoryNode(projectItem, FileNodeStatus.Missing); FileNodeStatus nodeStatus = node.FileNodeStatus; Assert.AreEqual(FileNodeStatus.Missing, nodeStatus); }
public void IsServiceReferencesFolder_FolderMatchesServiceReferencesFolder_ReturnsTrue() { CreateProjectItem(); project.FileName = @"C:\Projects\MyProject\MyProject.csproj"; projectItem.Include = @"Service References\"; string folder = @"C:\Projects\MyProject\Service References"; bool result = ServiceReferencesProjectItem.IsServiceReferencesFolder(project, folder); Assert.IsTrue(result); }
public void CreateDirectoryNode_ParentIsServiceReferencesFolderNode_CreatesServiceReferenceNode() { CreateProject(); ServiceReferencesProjectItem expectedProjectItem = AddWCFMetadataProjectItemToProject(); DirectoryNode parentServiceReferencesFolderNode = DirectoryNodeFactory.CreateDirectoryNode(expectedProjectItem, FileNodeStatus.None); string directory = "ServiceReference1"; ServiceReferenceNode node = DirectoryNodeFactory.CreateDirectoryNode(parentServiceReferencesFolderNode, project, directory) as ServiceReferenceNode; Assert.AreEqual("ServiceReference1", node.Directory.ToString()); }
public void CreateDirectoryNode_ProjectHasServiceReferencesItemAndDirectoryMatchesServiceReferencesPath_CreatesServiceReferencesFolderNode() { CreateProject(); project.FileName = FileName.Create(@"d:\projects\MyProject\MyProject.csproj"); ServiceReferencesProjectItem projectItem = AddWCFMetadataProjectItemToProject(); projectItem.Include = @"Service References\"; string directory = @"d:\projects\MyProject\Service References"; ServiceReferencesFolderNode referencesNode = DirectoryNodeFactory.CreateDirectoryNode(null, project, directory) as ServiceReferencesFolderNode; Assert.AreEqual(directory, referencesNode.Directory.ToString()); }
public void AddServiceReferenceProxyFile_ProjectHasNoServiceReferences_WCFMetadataItemAddedToProjectForServiceReferencesFolder() { CreateProjectWithMSBuildProject(); var proxyFileName = new ServiceReferenceFileName() { ServiceName = "Service1" }; project.AddServiceReferenceProxyFile(proxyFileName); ServiceReferencesProjectItem item = GetFirstWCFMetadataItemInMSBuildProject(); Assert.AreEqual("Service References", item.Include); }
public ServiceReferencesFolderNode(ServiceReferencesProjectItem projectItem, FileNodeStatus status) : this(projectItem.Directory, status) { this.ProjectItem = projectItem; }
void CreateServiceReferenceProjectItem() { CreateProject(); projectItem = new ServiceReferencesProjectItem(project); }