Example #1
0
        public void RemoveFromVariant_VariantContainsStringToRemoveAndStringToRemoveStartsWithUnderscore_StringIsNotRemoved()
        {
            var rfcTag = new Rfc5646Tag("en", String.Empty, String.Empty, "biske", String.Empty);

            rfcTag.RemoveFromVariant("_biske");
            Assert.AreEqual("biske", rfcTag.Variant);
        }
Example #2
0
        public void RemoveFromVariant_VariantContainsStringToRemoveAndStringToRemoveEndsWithDash_StringIsRemoved()
        {
            var rfcTag = new Rfc5646Tag("en", String.Empty, String.Empty, "biske", String.Empty);

            rfcTag.RemoveFromVariant("biske-");
            Assert.AreEqual(rfcTag.Variant, String.Empty);
        }
Example #3
0
        public void RemoveFromVariant_VariantContainsStringToRemoveInDifferentCase_VariantIsStrippedOfStringToRemoveAndPrecedingDash()
        {
            var rfcTag = new Rfc5646Tag("en", String.Empty, String.Empty, "1901-BisKe", String.Empty);

            rfcTag.RemoveFromVariant("biske");
            Assert.AreEqual("1901", rfcTag.Variant);
        }
Example #4
0
        public void RemoveFromVariant_VariantEqualsStringToRemoveInDifferentCase_VariantIsEmpty()
        {
            var rfcTag = new Rfc5646Tag("en", String.Empty, String.Empty, "bIsKe", String.Empty);

            rfcTag.RemoveFromVariant("biske");
            Assert.AreEqual(String.Empty, rfcTag.Variant);
        }
Example #5
0
        public void RemoveFromVariant_VariantContainsPartsOfStringToRemoveButNotConsecutively_RemovesPartsCorrectly()
        {
            var rfcTag = new Rfc5646Tag("en", String.Empty, String.Empty, "1901-bauddha-biske", String.Empty);

            rfcTag.RemoveFromVariant("1901-biske");
            Assert.AreEqual("bauddha", rfcTag.Variant);
        }
Example #6
0
        public void RemoveFromVariant_VariantDoesNotContainPartsOfStringToRemove_PartsThatAreContainedAreRemoved()
        {
            var rfcTag = new Rfc5646Tag("en", String.Empty, String.Empty, "1901-bauddha", String.Empty);

            rfcTag.RemoveFromVariant("biske-1901");
            Assert.AreEqual("bauddha", rfcTag.Variant);
        }
Example #7
0
        public void RemoveFromVariant_VariantDoesNotContainStringToRemove_VariantRemainsUntouched()
        {
            var rfcTag = new Rfc5646Tag("en", String.Empty, String.Empty, "1901", String.Empty);

            rfcTag.RemoveFromVariant("biske");
            Assert.AreEqual("1901", rfcTag.Variant);
        }
Example #8
0
        public void RemoveFromVariant_VariantIsEmpty_VariantRemainsUntouched()
        {
            var rfcTag = new Rfc5646Tag("en", String.Empty, String.Empty, String.Empty, String.Empty);

            rfcTag.RemoveFromVariant("biske");
            Assert.AreEqual(String.Empty, rfcTag.Variant);
        }
Example #9
0
        public void RemoveFromVariant_StringToRemoveInDifferentCaseIsFirstInVariant_VariantIsStrippedOfStringToRemoveAndFollowingDash()
        {
            var rfcTag = new Rfc5646Tag("en", String.Empty, String.Empty, "bIsKe-1901", String.Empty);

            rfcTag.RemoveFromVariant("biske");
            Assert.AreEqual("1901", rfcTag.Variant);
        }