示例#1
0
        public void WritingSystemIdHasBeenChanged_IdExistsAndHasNeverChanged_ReturnsFalse()
        {
            //Add a writing system to the repo
            var ws = new WritingSystemDefinition("en");

            RepositoryUnderTest.Set(ws);
            RepositoryUnderTest.Save();
            Assert.That(RepositoryUnderTest.WritingSystemIdHasChanged("en"), Is.False);
        }
示例#2
0
        public void WritingSystemIdHasBeenChanged_IdChanged_ReturnsTrue()
        {
            //Add a writing system to the repo
            var ws = new WritingSystemDefinition("en");

            RepositoryUnderTest.Set(ws);
            RepositoryUnderTest.Save();
            //Now change the Id
            ws.Variants.Add("bogus");
            RepositoryUnderTest.Save();
            Assert.That(RepositoryUnderTest.WritingSystemIdHasChanged("en"), Is.True);
        }
示例#3
0
        public void WritingSystemIdHasBeenChanged_IdChangedToMultipleDifferentNewIds_ReturnsTrue()
        {
            //Add a writing system to the repo
            var wsEn = new WritingSystemDefinition("en");

            RepositoryUnderTest.Set(wsEn);
            RepositoryUnderTest.Save();
            //Now change the Id and create a duplicate of the original Id
            wsEn.Variants.Add("bogus");
            RepositoryUnderTest.Set(wsEn);
            var wsEnDup = new WritingSystemDefinition("en");

            RepositoryUnderTest.Set(wsEnDup);
            RepositoryUnderTest.Save();
            //Now change the duplicate's Id as well
            wsEnDup.Variants.Add("bogus2");
            RepositoryUnderTest.Set(wsEnDup);
            RepositoryUnderTest.Save();
            Assert.That(RepositoryUnderTest.WritingSystemIdHasChanged("en"), Is.True);
        }