public void ValidationPassedWhenProjectDiffersButNameIsSame()
		{
			Store store = new Store(typeof(CoreDesignSurfaceDomainModel), typeof(HostDesignerDomainModel));
			using(Transaction t = store.TransactionManager.BeginTransaction())
			{
				HostApplication hostApp1 = new HostApplication(store, 
					new PropertyAssignment(HostApplication.ImplementationProjectDomainPropertyId, "Project1"));
				HostApplication hostApp2 = new HostApplication(store,
					new PropertyAssignment(HostApplication.ImplementationProjectDomainPropertyId, "SomeOtherProject"));
				
				HostDesignerModel model = new HostDesignerModel(store);
				
				model.HostApplications.Add(hostApp1);
				model.HostApplications.Add(hostApp2);
				
				ServiceReference serviceReference1 = new ServiceReference(store, 
					new PropertyAssignment(ServiceReference.NameDomainPropertyId, "ServiceRef1"));
				ServiceReference serviceReference2 = new ServiceReference(store,
					new PropertyAssignment(ServiceReference.NameDomainPropertyId, "ServiceRef1"));
				
				
				hostApp1.ServiceDescriptions.Add(serviceReference1);
				hostApp2.ServiceDescriptions.Add(serviceReference2);

				TestableHostModelContainsUniqueServiceReferencesAcrossHostsValidator validator = new TestableHostModelContainsUniqueServiceReferencesAcrossHostsValidator();

				Assert.IsTrue(validator.IsValid(model));
				
				
				t.Rollback();
			}
		}
        public void TestInitialize()
        {
            serviceProvider = new MockMappingServiceProvider();

			scStore = new Store(serviceProvider, typeof(CoreDesignSurfaceDomainModel), typeof(ServiceContractDslDomainModel));			
			scDomainModel = scStore.GetDomainModel<ServiceContractDslDomainModel>();
			scTransaction = scStore.TransactionManager.BeginTransaction();

			scModel = (ServiceContractModel)scDomainModel.CreateElement(new Partition(scStore), typeof(ServiceContractModel), null);
			scModel.ImplementationTechnology = new ServiceContractWCFExtensionProvider();
			scModel.ProjectMappingTable = projectMappingTableName;

			ServiceContract sc = scStore.ElementFactory.CreateElement(ServiceContract.DomainClassId) as ServiceContract;
			sc.Name = serviceContractName;

			scModel.ServiceContracts.Add(sc);

			hdStore = new Store(serviceProvider, typeof(CoreDesignSurfaceDomainModel), typeof(HostDesignerDomainModel));
			hdDomainModel = hdStore.GetDomainModel<HostDesignerDomainModel>();
            hdTransaction = hdStore.TransactionManager.BeginTransaction();
			hdModel = (HostDesignerModel)hdDomainModel.CreateElement(new Partition(hdStore), typeof(HostDesignerModel), null);

			HostApplication app = (HostApplication)hdStore.ElementFactory.CreateElement(HostApplication.DomainClassId);

			app.ImplementationTechnology = new HostDesignerWcfExtensionProvider();

			reference = (ServiceReference)hdStore.ElementFactory.CreateElement(ServiceReference.DomainClassId);

			//mel://[DSLNAMESPACE]\[MODELELEMENTTYPE]\[MODELELEMENT.GUID]@[PROJECT]\[MODELFILE]
			string serviceMoniker = string.Format(@"mel://{0}\{1}\{2}@{3}\{4}",
				sc.GetType().Namespace,
				serviceContractName,
				sc.Id.ToString(),
				serviceContractModelProjectName, serviceContractModelFileName);

			reference.Name = serviceMelReferenceName;
            reference.ServiceImplementationType = new MockModelBusReference(sc);

			app.ServiceDescriptions.Add(reference);

			// Initialize validator's config
            attributes = new NameValueCollection();
            attributes.Add("elementNameProperty", "Name");
        }
		private void CreateHostDesignerModel(ServiceContract sc)
		{
			hdStore = new Store(serviceProvider, typeof(CoreDesignSurfaceDomainModel), typeof(HostDesignerDomainModel));
			hdDomainModel = hdStore.GetDomainModel<HostDesignerDomainModel>();
			hdTransaction = hdStore.TransactionManager.BeginTransaction();
			hdModel = (HostDesignerModel)hdDomainModel.CreateElement(new Partition(hdStore), typeof(HostDesignerModel), null);

			HostApplication app = (HostApplication)hdStore.ElementFactory.CreateElement(HostApplication.DomainClassId);

			app.ImplementationTechnology = new HostDesignerWcfExtensionProvider();

			reference = (ServiceReference)hdStore.ElementFactory.CreateElement(ServiceReference.DomainClassId);

			//mel://[DSLNAMESPACE]\[MODELELEMENTTYPE]\[MODELELEMENT.GUID]@[PROJECT]\[MODELFILE]
			string serviceMoniker = string.Format(@"mel://{0}\{1}\{2}@{3}\{4}",
				sc.GetType().Namespace,
				serviceContractName,
				sc.Id.ToString(),
				serviceContractModelProjectName, serviceContractModelFileName);

			reference.Name = serviceMelReferenceName;
            reference.ServiceImplementationType = new MockModelBusReference(sc);

			app.ServiceDescriptions.Add(reference);
		}