Пример #1
0
        public void DuplicateIdTest()
        {
            // SUT (use workFolder as the root directory)
            BookTransfer.BulkRepairInstanceIds(_workFolderPath);

            // Verification
            var book1 = _foldersToDispose[3];
            var book2 = _foldersToDispose[4];
            var book3 = _foldersToDispose[5];
            var book4 = _foldersToDispose[6];
            var book5 = _foldersToDispose[7];

            Assert.That(GetInstanceIdFromMetadataFile(book1), Is.Not.EqualTo(_guid1), "book1 should have changed guid1");
            Assert.That(GetInstanceIdFromMetadataFile(book2), Is.Not.EqualTo(_guid1), "book2 should have changed guid1");
            Assert.That(GetInstanceIdFromMetadataFile(book1), Is.Not.EqualTo(GetInstanceIdFromMetadataFile(book2)), "book1 should have different guid than book2");
            Assert.That(GetInstanceIdFromMetadataFile(book3), Is.EqualTo(_guid1), "book3 should have guid1");
            Assert.That(GetInstanceIdFromMetadataFile(book4), Is.EqualTo(_guid2), "book4 should have guid2");
            Assert.That(GetInstanceIdFromMetadataFile(book4), Is.Not.EqualTo(GetInstanceIdFromMetadataFile(book5)), "book4 should have different guid than book5");
        }