Exemplo n.º 1
0
        public void AddToVariant_StringToAddConsistsOfMultipleParts_StringToAddIsAppendedToVariantWithDashDelimiter()
        {
            var rfcTag = new RFC5646Tag("en", String.Empty, String.Empty, "1901", String.Empty);

            rfcTag.AddToVariant("bauddha-biske");
            Assert.AreEqual("1901-bauddha-biske", rfcTag.Variant);
        }
Exemplo n.º 2
0
        public void AddToVariant_StringToAddEndsWithDash_StringIsAdded()
        {
            var rfcTag = new RFC5646Tag("en", String.Empty, String.Empty, "1901", String.Empty);

            rfcTag.AddToVariant("biske-");
            Assert.AreEqual("1901-biske", rfcTag.Variant);
        }
Exemplo n.º 3
0
        public void AddToVariant_VariantIsNotEmpty_StringToAddIsAppendedToVariantWithDashDelimiter()
        {
            var rfcTag = new RFC5646Tag("en", String.Empty, String.Empty, "1901", String.Empty);

            rfcTag.AddToVariant("bauddha");
            Assert.AreEqual("1901-bauddha", rfcTag.Variant);
        }
Exemplo n.º 4
0
        public void AddToVariant_VariantIsEmpty_VariantEqualsStringToAdd()
        {
            var rfcTag = new RFC5646Tag("en", String.Empty, String.Empty, String.Empty, String.Empty);

            rfcTag.AddToVariant("1901");
            Assert.AreEqual("1901", rfcTag.Variant);
        }
Exemplo n.º 5
0
        public void AddToVariant_StringToAddIsNotValidVariant_Throws()
        {
            var rfcTag = new RFC5646Tag("en", String.Empty, String.Empty, String.Empty, String.Empty);

            Assert.Throws <ValidationException>(() => rfcTag.AddToVariant("bogus"));
        }
Exemplo n.º 6
0
        public void AddToVariant_StringToAddBeginsWithx_Throws()
        {
            var rfcTag = new RFC5646Tag("en", String.Empty, String.Empty, "biske", String.Empty);

            Assert.Throws <ValidationException>(() => rfcTag.AddToVariant("x-bauddha"));
        }
Exemplo n.º 7
0
        public void AddToVariant_VariantAlreadyContainsStringToAddInDifferentCase_Throws()
        {
            var rfcTag = new RFC5646Tag("en", String.Empty, String.Empty, "BisKe", String.Empty);

            Assert.Throws <ValidationException>(() => rfcTag.AddToVariant("biske"));
        }
Exemplo n.º 8
0
        public void AddToVariant_VariantAlreadyContainsPartsOfStringToAdd_Throws()
        {
            var rfcTag = new RFC5646Tag("en", String.Empty, String.Empty, "bauddha-biske", String.Empty);

            Assert.Throws <ValidationException>(() => rfcTag.AddToVariant("1901-bauddha"));
        }
Exemplo n.º 9
0
        public void AddToVariant_StringToAddContainsInvalidCharacter_Throws()
        {
            var rfcTag = new RFC5646Tag("en", String.Empty, String.Empty, String.Empty, String.Empty);

            Assert.Throws <ValidationException>(() => rfcTag.AddToVariant("1901_bauddha"));
        }