Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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"));
        }