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);
        }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
Exemple #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);
        }
Exemple #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"));
        }