Пример #1
0
        public void RemoveFromPrivateUse_PrivateUseContainsStringToRemoveAndStringToRemoveStartsWithUnderscore_DoesNotRemoveString()
        {
            var rfcTag = new RFC5646Tag("en", String.Empty, String.Empty, String.Empty, "AudiO");

            rfcTag.RemoveFromPrivateUse("_!@#$bogus");
            Assert.AreEqual("x-AudiO", rfcTag.PrivateUse);
        }
Пример #2
0
        public void RemoveFromPrivateUse_PrivateUseContainsStringToRemoveAndStringToRemoveEndsWithDash_StringIsRemoved()
        {
            var rfcTag = new RFC5646Tag("en", String.Empty, String.Empty, String.Empty, "AudiO");

            rfcTag.RemoveFromPrivateUse("audio-");
            Assert.AreEqual(rfcTag.PrivateUse, String.Empty);
        }
Пример #3
0
        public void RemoveFromPrivateUse_PrivateUseContainsStringToRemoveInDifferentCase_PrivateUseIsStrippedOfStringToRemoveAndPrecedingDash()
        {
            var rfcTag = new RFC5646Tag("en", String.Empty, String.Empty, String.Empty, "test-aUdiO");

            rfcTag.RemoveFromPrivateUse("audio");
            Assert.AreEqual("x-test", rfcTag.PrivateUse);
        }
Пример #4
0
        public void RemoveFromPrivateUse_PrivateUseEqualsStringToRemoveInDifferentCase_PrivateUseIsEmpty()
        {
            var rfcTag = new RFC5646Tag("en", String.Empty, String.Empty, String.Empty, "AudiO");

            rfcTag.RemoveFromPrivateUse("audio");
            Assert.AreEqual(String.Empty, rfcTag.PrivateUse);
        }
Пример #5
0
        public void RemoveFromPrivateUse_PrivateUseContainsPartsOfStringToRemoveButNotConsecutively_RemovesPartsCorrectly()
        {
            var rfcTag = new RFC5646Tag("en", String.Empty, String.Empty, String.Empty, "test-smth-audio");

            rfcTag.RemoveFromPrivateUse("test-audio");
            Assert.AreEqual("x-smth", rfcTag.PrivateUse);
        }
Пример #6
0
        public void RemoveFromPrivateUse_PrivateUseDoesNotContainPartsOfStringToRemove_PartsThatAreContainedAreRemoved()
        {
            var rfcTag = new RFC5646Tag("en", String.Empty, String.Empty, String.Empty, "test");

            rfcTag.RemoveFromPrivateUse("test-audio");
            Assert.AreEqual(String.Empty, rfcTag.PrivateUse);
        }
Пример #7
0
        public void RemoveFromPrivateUse_PrivateUseDoesNotContainStringToRemove_PrivateUseRemainsUntouched()
        {
            var rfcTag = new RFC5646Tag("en", String.Empty, String.Empty, String.Empty, "test");

            rfcTag.RemoveFromPrivateUse("audio");
            Assert.AreEqual("x-test", rfcTag.PrivateUse);
        }
Пример #8
0
        public void RemoveFromPrivateUse_PrivateUseIsEmpty_PrivateUseRemainsUntouched()
        {
            var rfcTag = new RFC5646Tag("en", String.Empty, String.Empty, String.Empty, String.Empty);

            rfcTag.RemoveFromPrivateUse("audio");
            Assert.AreEqual(String.Empty, rfcTag.PrivateUse);
        }
Пример #9
0
        public void RemoveFromPrivateUse_StringToremoveIsNotPrependedByxDash_StringIsRemoved()
        {
            var rfcTag = new RFC5646Tag("en", String.Empty, String.Empty, String.Empty, "audio");

            rfcTag.RemoveFromPrivateUse("audio");
            Assert.AreEqual(String.Empty, rfcTag.PrivateUse);
        }
Пример #10
0
        public void RemoveFromPrivateUse_StringToTRemoveIsPrependedByxDash_Throws()
        {
            var rfcTag = new RFC5646Tag("en", String.Empty, String.Empty, String.Empty, "audio");

            rfcTag.RemoveFromPrivateUse("x-audio");
            Assert.AreEqual(String.Empty, rfcTag.PrivateUse);
        }
Пример #11
0
        public void RemoveFromPrivateUse_PrivateUseContainsPartAndNoValidlanguageTag_Throws()
        {
            var rfcTag = new RFC5646Tag(String.Empty, String.Empty, String.Empty, String.Empty, "test");

            Assert.Throws <ValidationException>(() => rfcTag.RemoveFromPrivateUse("x-test"));
        }