Ejemplo n.º 1
0
        public void AddAnExistingSibling_MustBeIgnored()
        {
            HashTag h1 = new HashTag()
            {
                Name = "h1"
            };

            HashTag h2 = new HashTag()
            {
                Name = "h2"
            };

            h1.AddSibling(h2);
            h1.AddSibling(h2);

            int expectedSiblingsCount = 1;

            Assert.AreEqual<int>(expectedSiblingsCount, h1.Siblings.Length);
        }
Ejemplo n.º 2
0
        public void RemoveSiblingFromOneHashTag_MustRemoveBothFromEachOthersSiblingsList()
        {
            HashTag h1 = new HashTag()
            {
                Name = "h1"
            };

            HashTag h2 = new HashTag()
            {
                Name = "h2"
            };

            h1.AddSibling(h2);
            h1.RemoveSibling(h2);

            int expectedSiblingsCount = 0;

            Assert.AreEqual<int>(expectedSiblingsCount, h2.Siblings.Length);
        }
Ejemplo n.º 3
0
        public void RemoveSibling()
        {
            HashTag h1 = new HashTag()
            {
                Name = "h1"
            };

            HashTag h2 = new HashTag()
            {
                Name = "h2"
            };

            h1.AddSibling(h2);
            h1.RemoveSibling(h2);

            int expectedSiblingsCount = 0;

            Assert.AreEqual<int>(expectedSiblingsCount, h1.Siblings.Length);
        }
Ejemplo n.º 4
0
        public void AddSiblingToOneHashTag_MustMakeBothEachOthersSiblings()
        {
            HashTag h1 = new HashTag()
            {
                Name = "h1"
            };

            HashTag h2 = new HashTag()
            {
                Name = "h2"
            };

            h1.AddSibling(h2);

            int expectedSiblingsCountDifference = 0;
            int actualSiblingsCountDifference = h1.Siblings.Length - h2.Siblings.Length;

            Assert.AreEqual<int>(expectedSiblingsCountDifference, actualSiblingsCountDifference);
            Assert.AreSame(h2, h1.Siblings[0]);
            Assert.AreSame(h1, h2.Siblings[0]);
        }