Esempio n. 1
0
        public void TestThatTranslationsForDomainObjectGetGetsTranslationsForIdentifiableDomainObject()
        {
            var translationInfos = _systemDataRepository.TranslationInfoGetAll().ToArray();
            var tranlationOf     = new Translation(Guid.NewGuid(), translationInfos.FirstOrDefault(), "Test")
            {
                Identifier = Guid.NewGuid()
            };
            // ReSharper disable PossibleInvalidOperationException
            var translation = _systemDataRepository.Insert(new Translation(tranlationOf.Identifier.Value, translationInfos.FirstOrDefault(), "Test"));

            // ReSharper restore PossibleInvalidOperationException
            try
            {
                // ReSharper disable PossibleInvalidOperationException
                var result = _systemDataRepository.TranslationsForDomainObjectGet(tranlationOf);
                // ReSharper restore PossibleInvalidOperationException
                // ReSharper disable PossibleMultipleEnumeration
                Assert.That(result, Is.Not.Null);
                Assert.That(result, Is.Not.Empty);
                // ReSharper restore PossibleMultipleEnumeration
            }
            finally
            {
                _systemDataRepository.Delete(translation);
            }
        }