예제 #1
0
        public void IncreaseChildCount_adds_child_and_increases_it()
        {
            var entityUnderTest = new DreamMainStatTag("Hello");

            entityUnderTest.IncreaseChildCount("there");
            entityUnderTest.ChildStatTags.Single(x => x.Tag == "There").TagCount.Should().Be(1);
            entityUnderTest.IncreaseChildCount("THERE");
            entityUnderTest.ChildStatTags.Single(x => x.Tag == "There").TagCount.Should().Be(2);
        }
예제 #2
0
        public void IncreaseCount_causes_TagCount_to_increase()
        {
            var entityUnderTest = new DreamMainStatTag("Hello");

            entityUnderTest.TagCount.Should().Be(0);
            entityUnderTest.IncreaseCount();
            entityUnderTest.TagCount.Should().Be(1);
            entityUnderTest.IncreaseCount();
            entityUnderTest.TagCount.Should().Be(2);
        }
예제 #3
0
        private DreamMainStatTag GetExistingOrCreateMainTag(string tagName)
        {
            var existingTag = TagStatistics.SingleOrDefault(x => x.IsTag(tagName));

            if (existingTag != null)
            {
                return(existingTag);
            }

            var newStatTag = new DreamMainStatTag(tagName);

            _tagStatistics.Add(newStatTag);
            return(newStatTag);
        }
예제 #4
0
        public void TagCount_initially_is_0()
        {
            var entityUnderTest = new DreamMainStatTag("Hello");

            entityUnderTest.TagCount.Should().Be(0);
        }