public void ShouldGetByIntId()
        {
            // given
            var id = int.Parse(sourcesystem.ToMdmId().Identifier);

            // when
            var response = MdmService.Get <SourceSystem>(id);

            // then
            Assert.IsTrue(response.IsValid, "###Error : " + response.Code + " : " + (response.Fault == null ? string.Empty : response.Fault.Message + " : " + response.Fault.Reason));
            Check(sourcesystem, response.Message);
        }
        public void ReturnNullForZeroIdentifiers()
        {
            var entity = new SourceSystem();

            var candidate = entity.ToMdmId();

            Assert.IsNull(candidate);
        }
        public void ReturnNullForNullMdmEntity()
        {
            SourceSystem entity = null;

            var candidate = entity.ToMdmId();

            Assert.IsNull(candidate);
        }
        public void ShouldSucceedUpdateWhenETagMatches()
        {
            // given
            var id = int.Parse(sourcesystem.ToMdmId().Identifier);

            // when
            var response = MdmService.Get <SourceSystem>(id);
            var entity   = response.Message;

            entity.Identifiers = new MdmIdList()
            {
                entity.Identifiers.SystemId()
            };

            // then
            response = MdmService.Update(id, entity, response.Tag);

            Assert.IsTrue(response.IsValid, "###Error : " + response.Code + " : " + (response.Fault == null ? string.Empty : response.Fault.Message + " : " + response.Fault.Reason));
        }
        public void ReturnNullForNoNexusIdentifier()
        {
            var entity = new SourceSystem();

            entity.Identifiers.Add(new MdmId());

            var candidate = entity.ToMdmId();

            Assert.IsNull(candidate);
        }
        public void ReturnNexusIdentifier()
        {
            var expected = new MdmId {
                Identifier = "1", IsMdmId = true
            };
            var entity = new SourceSystem {
                Identifiers = new MdmIdList {
                    new MdmId(), expected
                }
            };

            var candidate = entity.ToMdmId();

            Assert.AreEqual(expected, candidate);
        }