Пример #1
0
        public static void CompareContractWithSavedEntity(OpenNexus.MDM.Contracts.PartyRole contract)
        {
            int id          = int.Parse(contract.Identifiers.Where(x => x.IsMdmId).First().Identifier);
            var savedEntity = new DbSetRepository(new DbContextProvider(() => new NexusMappingContext())).FindOne <MDM.PartyRole>(id);

            CompareContractWithEntityDetails(contract, savedEntity);
        }
Пример #2
0
        public static void CompareContractWithEntityDetails(OpenNexus.MDM.Contracts.PartyRole contract, MDM.PartyRole entity)
        {
            MDM.PartyRoleDetails detailsToCompare = entity.Details[0];

            if (contract.MdmSystemData != null)
            {
                detailsToCompare = entity.Details.Where(details => details.Validity.Start == contract.MdmSystemData.StartDate).First();
            }

            Assert.AreEqual(contract.Details.Name, detailsToCompare.Name);
        }
Пример #3
0
        public static void ConfirmEntitySaved(int id, OpenNexus.MDM.Contracts.PartyRole contract)
        {
            var savedEntity =
                new DbSetRepository(new DbContextProvider(() => new NexusMappingContext())).FindOne <MDM.PartyRole>(id);

            contract.Identifiers.Add(new MdmId()
            {
                IsMdmId = true, Identifier = id.ToString()
            });

            CompareContractWithEntityDetails(contract, savedEntity);
        }
Пример #4
0
 public void should_not_return_a_partyrole()
 {
     OpenNexus.MDM.Contracts.PartyRole returnedPartyRole = null;
     try { returnedPartyRole = response.Content.ReadAsDataContract <OpenNexus.MDM.Contracts.PartyRole>(); } catch { }
     Assert.IsNull(returnedPartyRole);
 }