public void Setup()
		{
			projectId = Guid.NewGuid();
			Role role = new Role("FooRole");
			Role role1 = new Role("FooRole1");
			ProjectMapping.Configuration.ProjectMappingEntry projectMapping =
				new ProjectMapping.Configuration.ProjectMappingEntry(
					projectId,
                    @"\", "FooName");
			projectMapping.Roles.Add(role);
			projectMapping.Roles.Add(role1);

			ProjectMappingTable mappingTable = new ProjectMappingTable("Foo");
			mappingTable.ProjectMappings.Add(projectMapping);

			info = new ProjectMappingInformation("Foo.rolemapping");
			info.ProjectMappingTables.Add(mappingTable);
		}
		public void ShouldNotDeleteAProjectMappingEntryTwice()
		{
			Guid projectGuid = new Guid("A168E8C3-8CCD-47cd-AE2B-BE0F85F66782");

			ProjectMapping.Configuration.ProjectMappingEntry projectMapping =
				new ProjectMapping.Configuration.ProjectMappingEntry(
					projectGuid,
                    @"\Foo", "FooName");

			ProjectMappingTable projectMappingTable = new ProjectMappingTable("FooEntry2");
			manager.AddProjectMappingTableEntry(projectMappingTable);

			manager.AddProjectMappingEntry("FooEntry2", projectMapping);

			manager.DeleteProjectMappingEntry("FooEntry2", projectGuid);
			manager.DeleteProjectMappingEntry("FooEntry2", projectGuid);
		}
		public void ShouldDeleteAProjectMappingTableEntry()
		{
			ProjectMappingTable projectMappingTable = new ProjectMappingTable("FOOEntry1");
			manager.AddProjectMappingTableEntry(projectMappingTable);

			manager.DeleteProjectMappingTableEntry("FOOEntry1");
			manager.DeleteProjectMappingTableEntry("FOOEntry1");
		}
		public void ShouldAddAProjectMappingTableEntry()
		{
			ProjectMappingTable projectMappingTable = new ProjectMappingTable("FOOEntry");

			manager.AddProjectMappingTableEntry(projectMappingTable);
			manager.AddProjectMappingTableEntry(projectMappingTable);
		}
		public void ShouldNotAddAProjectMappingTableEntryThatAlreadyExists()
		{
			ProjectMappingTable projectMappingTable = new ProjectMappingTable(WcfMappingTableName);

			manager.AddProjectMappingTableEntry(projectMappingTable);
		}
		private bool EnsureMappingTableExists()
		{
            if (manager.GetMappingTable(mappingTableName) != null)
			{
				mappingTableName = CreateNewMappingTableName();
                // Ask to proceed with new name
                IUIService ui = this.GetService<IUIService>();
                if (ui.ShowMessage(
                    string.Format(CultureInfo.CurrentCulture, Resources.CreateNewMappingTable, mappingTableName), 
                    null, MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return false;
                }
			}
			// Create new mapping table
			ProjectMappingTable projectMappingTable = new ProjectMappingTable(mappingTableName);
            manager.AddProjectMappingTableEntry(projectMappingTable);
            return true;
		}