public void GetObjectNameReturnsReturnsTypeNameForUnnamedModelElement()
        {
            Store store = new Store(typeof(CoreDesignSurfaceDomainModel), typeof(ServiceContractDslDomainModel));
            ServiceContractModel model;

            using (Transaction transaction = store.TransactionManager.BeginTransaction())
            {
                model = store.ElementFactory.CreateElement(ServiceContractModel.DomainClassId) as ServiceContractModel;

                UniqueNamedElementCollectionValidator <ServiceContractModel> target = new UniqueNamedElementCollectionValidator <ServiceContractModel>(null);

                string actual = target.GetObjectName(model);
                Assert.AreEqual("Service Contract Model", actual);

                transaction.Commit();
            }
        }
		public void GetObjectNameReturnsReturnsTypeNameForUnnamedModelElement()
		{
			Store store = new Store(typeof(CoreDesignSurfaceDomainModel), typeof(ServiceContractDslDomainModel));
			ServiceContractModel model;

			using (Transaction transaction = store.TransactionManager.BeginTransaction())
			{
				model = store.ElementFactory.CreateElement(ServiceContractModel.DomainClassId) as ServiceContractModel;

				UniqueNamedElementCollectionValidator<ServiceContractModel> target = new UniqueNamedElementCollectionValidator<ServiceContractModel>(null);

				string actual = target.GetObjectName(model);
				Assert.AreEqual("Service Contract Model", actual);

				transaction.Commit();
			}
		}
        public void GetObjectNameReturnsCorrectNameForNamedModelElement()
        {
            Store store = new Store(typeof(CoreDesignSurfaceDomainModel), typeof(ServiceContractDslDomainModel));
            ServiceContractModel model;
            ServiceContract      element;

            using (Transaction transaction = store.TransactionManager.BeginTransaction())
            {
                string expected = "My Name";
                model   = store.ElementFactory.CreateElement(ServiceContractModel.DomainClassId) as ServiceContractModel;
                element = store.ElementFactory.CreateElement(ServiceContract.DomainClassId) as ServiceContract;

                element.Name = expected;

                UniqueNamedElementCollectionValidator <ServiceContract> target = new UniqueNamedElementCollectionValidator <ServiceContract>(null);

                string actual = target.GetObjectName(element);
                Assert.AreEqual(expected, actual);

                transaction.Commit();
            }
        }
		public void GetObjectNameReturnsCorrectNameForNamedModelElement()
		{
			Store store = new Store(typeof(CoreDesignSurfaceDomainModel), typeof(ServiceContractDslDomainModel));
			ServiceContractModel model;
			ServiceContract element;

			using (Transaction transaction = store.TransactionManager.BeginTransaction())
			{
				string expected = "My Name";
				model = store.ElementFactory.CreateElement(ServiceContractModel.DomainClassId) as ServiceContractModel;
				element = store.ElementFactory.CreateElement(ServiceContract.DomainClassId) as ServiceContract;

				element.Name = expected;

				UniqueNamedElementCollectionValidator<ServiceContract> target = new UniqueNamedElementCollectionValidator<ServiceContract>(null);

				string actual = target.GetObjectName(element);
				Assert.AreEqual(expected, actual);

				transaction.Commit();
			}
		}