コード例 #1
0
        public void ShouldOnlyAutoGenerateUnspecifiedTaggedValues()
        {
            ICctsRepository ccRepository = CctsRepositoryFactory.CreateCctsRepository(new CdtLibraryTestRepository());
            ICdtLibrary     cdtLibrary   = ccRepository.GetCdtLibraryByPath(CdtLibraryTestRepository.PathToCdtLibrary());

            CdtSpec cdtSpec = new CdtSpec {
                Name = "cdt1", UniqueIdentifier = "{x-123-456-789-x}", DictionaryEntryName = "shouldNotBeReplaced"
            };
            ICdt cdt = cdtLibrary.CreateCdt(cdtSpec);

            Assert.That(cdt.UniqueIdentifier, Is.EqualTo("{x-123-456-789-x}"));
            Assert.That(cdt.DictionaryEntryName, Is.EqualTo("shouldNotBeReplaced"));
        }
コード例 #2
0
        public void ShouldAutoGenerateTaggedValues()
        {
            ICctsRepository ccRepository = CctsRepositoryFactory.CreateCctsRepository(new CdtLibraryTestRepository());
            ICdtLibrary     cdtLibrary   = ccRepository.GetCdtLibraryByPath(CdtLibraryTestRepository.PathToCdtLibrary());

            CdtSpec cdtSpec = new CdtSpec {
                Name = "cdt1"
            };
            ICdt cdt = cdtLibrary.CreateCdt(cdtSpec);

            Assert.That(cdt.UniqueIdentifier, Is.Not.Null);
            Assert.That(cdt.UniqueIdentifier, Is.Not.Empty);
            Assert.That(cdt.DictionaryEntryName, Is.EqualTo("cdt1. Type"));
        }
コード例 #3
0
        public void ShouldNotAutoGenerateSpecifiedTaggedValues()
        {
            ICctsRepository ccRepository = CctsRepositoryFactory.CreateCctsRepository(new CdtLibraryTestRepository());
            ICdtLibrary     cdtLibrary   = ccRepository.GetCdtLibraryByPath(CdtLibraryTestRepository.PathToCdtLibrary());

            ICdt cdtText = ccRepository.GetCdtByPath(CdtLibraryTestRepository.PathToCdtText());

            CdtSpec cdtSpec = CdtSpec.CloneCdt(cdtText);

            cdtSpec.DictionaryEntryName = "cdt1";
            cdtSpec.UniqueIdentifier    = "{1-2-3}";

            ICdt updatedCdt = cdtLibrary.UpdateCdt(cdtText, cdtSpec);

            Assert.That(updatedCdt.UniqueIdentifier, Is.EqualTo("{1-2-3}"));
            Assert.That(updatedCdt.DictionaryEntryName, Is.EqualTo("cdt1"));
        }